diff --git a/src/goofi/connection.py b/src/goofi/connection.py index 678bda3..2b94d2d 100644 --- a/src/goofi/connection.py +++ b/src/goofi/connection.py @@ -162,8 +162,11 @@ def close(self) -> None: def __del__(self) -> None: """Destructor to close the connection and free any resources associated with it.""" - self.close() - self.conn._handle = None + try: + self.close() + self.conn._handle = None + except Exception: + pass class ZeroMQConnection(Connection, ABC):