From 7d989faae6e63f13055761c1521328348b4f45bd Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Fri, 21 Feb 2020 12:00:34 +0100 Subject: [PATCH] feat: error handling during disconnection fix: various session disctonnect error (replication submodule) --- multi_user/libs/replication | 2 +- multi_user/operators.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/multi_user/libs/replication b/multi_user/libs/replication index 0f2ae75..90fdb44 160000 --- a/multi_user/libs/replication +++ b/multi_user/libs/replication @@ -1 +1 @@ -Subproject commit 0f2ae759a710609031c24c251249d39a4d37173d +Subproject commit 90fdb447f327ee9a02bcdd62adec6f89f6ab3749 diff --git a/multi_user/operators.py b/multi_user/operators.py index 6840ae6..077ff5d 100644 --- a/multi_user/operators.py +++ b/multi_user/operators.py @@ -159,23 +159,24 @@ class SessionStopOperator(bpy.types.Operator): def execute(self, context): global client, delayables, stop_modal_executor, server_process - - if server_process: - server_process.kill() - + assert(client) stop_modal_executor = True settings = context.window_manager.session settings.is_admin = False - assert(client) - - client.disconnect() for d in delayables: try: d.unregister() except: continue - presence.renderer.stop() + presence.renderer.stop() + + try: + client.disconnect() + except Exception as e: + self.report({'ERROR'}, repr(e)) + + client = None return {"FINISHED"}