diff --git a/net_components.py b/net_components.py index 0da8372..4c708b4 100644 --- a/net_components.py +++ b/net_components.py @@ -149,11 +149,11 @@ class Client(): def stop(self): logger.info("Stopping client") + self.poller.unregister(self.pull_sock) self.is_running = False - self.task.cancel() self.push_sock.close() self.pull_sock.close() - self.context.term() + self.task.cancel() class Server(): @@ -205,7 +205,8 @@ class Server(): def stop(self): logger.info("Stopping server") - self.task.cancel() + self.poller.unregister(self.pull_sock) self.pub_sock.close() self.pull_sock.close() - self.context.term() + + self.task.cancel() diff --git a/net_operators.py b/net_operators.py index 22eafff..67fa964 100644 --- a/net_operators.py +++ b/net_operators.py @@ -173,8 +173,12 @@ class session_stop(bpy.types.Operator): if server : server.stop() + del server + server = None if client: client.stop() + del client + client = None bpy.ops.asyncio.stop() else: logger.info("No server/client running.") diff --git a/net_ui.py b/net_ui.py index 6ded5df..f89784c 100644 --- a/net_ui.py +++ b/net_ui.py @@ -30,8 +30,6 @@ class SessionPanel(bpy.types.Panel): row = layout.row() # Debug area - row.label(text="Debug") - row = layout.row() area_msg = row.box() if len(net_operators.client.store) > 0: