diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index 6606c8dd0..eb56d429d 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -296,9 +296,11 @@ impl Connection { impl Drop for Connection { fn drop(&mut self) { - self.conn - .close() - .expect("Failed to drop (close) connection"); + if Arc::strong_count(&self.conn) == 1 { + self.conn + .close() + .expect("Failed to drop (close) connection"); + } } }