diff --git a/spine_engine/server/engine_server.py b/spine_engine/server/engine_server.py index 21c9c70..9ef1956 100644 --- a/spine_engine/server/engine_server.py +++ b/spine_engine/server/engine_server.py @@ -83,7 +83,7 @@ def close(self): """Closes the server by sending a KILL message to this thread using a PAIR socket.""" if self.auth is not None: self.auth.stop() - time.sleep(0.2) # wait a bit until authenticator has been closed + self.auth.thread.join() self.ctrl_msg_sender.send(b"KILL") self.join() # Wait for the thread to finish and sockets to close self.ctrl_msg_sender.close() # Close this in the same thread that it was created in