diff --git a/omero2pandas/connect.py b/omero2pandas/connect.py index 87638ed..f1ccc40 100644 --- a/omero2pandas/connect.py +++ b/omero2pandas/connect.py @@ -39,6 +39,7 @@ def __init__(self, client=None, server=None, port=4064, username=None, trying to use credentials. Default True. """ self.client = client + self.external_client = client is not None self.session = None self.gateway = None self.temp_session = False @@ -85,7 +86,8 @@ def shutdown(self): def __del__(self): # Make sure we close sessions on deletion. - self.shutdown() + if not self.external_client: + self.shutdown() @property def connected(self):