diff --git a/src/driver.rs b/src/driver.rs index 26bde37..3876752 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -95,10 +95,10 @@ impl MediaDriver { impl Drop for MediaDriver { fn drop(&mut self) { - if self.c_driver.is_null() { + if !self.c_driver.is_null() { unsafe { aeron_op!(aeron_driver_close(self.c_driver)) }.unwrap(); } - if self.c_context.is_null() { + if !self.c_context.is_null() { unsafe { aeron_op!(aeron_driver_context_close(self.c_context)) }.unwrap(); } }