From ec0dbfc0d7656087e46467b25693e8c827051d9b Mon Sep 17 00:00:00 2001 From: zhangzhanqun Date: Tue, 5 Mar 2024 14:09:41 +0800 Subject: [PATCH] try to fix bug for quit function --- src/ansys/dyna/core/pre/dynasolution.py | 4 ++-- src/ansys/dyna/core/solver/dynasolver.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ansys/dyna/core/pre/dynasolution.py b/src/ansys/dyna/core/pre/dynasolution.py index 563d72df8..6c3d59f49 100644 --- a/src/ansys/dyna/core/pre/dynasolution.py +++ b/src/ansys/dyna/core/pre/dynasolution.py @@ -433,8 +433,8 @@ def save_file(self): def quit(self): """Delete remote instance.""" - if self.pim_client is not None: - self.pim_client.close() if self.remote_instance is not None: self.remote_instance.delete() + if self.pim_client is not None: + self.pim_client.close() return diff --git a/src/ansys/dyna/core/solver/dynasolver.py b/src/ansys/dyna/core/solver/dynasolver.py index e702beace..e52fd5fd1 100644 --- a/src/ansys/dyna/core/solver/dynasolver.py +++ b/src/ansys/dyna/core/solver/dynasolver.py @@ -350,10 +350,10 @@ def quit(self): command and continues running. """ self.logger.debug("quit") - if self.pim_client is not None: - self.pim_client.close() if self.remote_instance is not None: self.remote_instance.delete() + if self.pim_client is not None: + self.pim_client.close() request = dynasolver_pb2.QuitServer() # ALWAYS returns ACK, so don't bother checking self.stub.quit_server(request)