From 5f57b0f314509bdf59774ce23a332057d88b5e18 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Mon, 28 Dec 2020 19:43:11 -0800 Subject: [PATCH] Remove event registration when task panel is destroyed. --- src/Mod/Path/PathScripts/PathOpGui.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Mod/Path/PathScripts/PathOpGui.py b/src/Mod/Path/PathScripts/PathOpGui.py index d0d5c22d83..dd589c9c85 100644 --- a/src/Mod/Path/PathScripts/PathOpGui.py +++ b/src/Mod/Path/PathScripts/PathOpGui.py @@ -212,9 +212,12 @@ class TaskPanelPage(object): self.parent = None self.panelTitle = 'Operation' - if hasattr(self.form, 'toolController'): + if self._installTCUpdate(): PathJob.Notification.updateTC.connect(self.resetToolController) + def _installTCUpdate(self): + return hasattr(self.form, 'toolController') + def setParent(self, parent): '''setParent() ... used to transfer parent object link to child class. Do not overwrite.''' @@ -250,6 +253,8 @@ class TaskPanelPage(object): def pageCleanup(self): '''pageCleanup() ... internal callback. Do not overwrite, implement cleanupPage(obj) instead.''' + if self._installTCUpdate(): + PathJob.Notification.updateTC.disconnect(self.resetToolController) self.cleanupPage(self.obj) def pageRegisterSignalHandlers(self):