From 0ba57765c3500c8e301d22f53ae0315ec7043e8d Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sun, 20 Jan 2019 12:48:19 -0800 Subject: [PATCH] Fixed segfault on shutdown --- src/Mod/Path/PathScripts/PathJobDlg.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathJobDlg.py b/src/Mod/Path/PathScripts/PathJobDlg.py index 53773d554e..4d02b9c327 100644 --- a/src/Mod/Path/PathScripts/PathJobDlg.py +++ b/src/Mod/Path/PathScripts/PathJobDlg.py @@ -170,7 +170,6 @@ class JobCreate: self.dialog.modelTree.setEditTriggers(QtGui.QAbstractItemView.AllEditTriggers) self.dialog.modelTree.setSelectionBehavior(QtGui.QAbstractItemView.SelectItems) - self.model.dataChanged.connect(self.updateData) self.dialog.modelGroup.show() def updateData(self, topLeft, bottomRight): @@ -261,7 +260,13 @@ class JobCreate: return self.dialog.jobTemplate.itemData(self.dialog.jobTemplate.currentIndex()) def exec_(self): - return self.dialog.exec_() + # ml: For some reason the callback has to be unregistered, otherwise there is a + # segfault when python is shutdown. To keep it symmetric I also put the callback + # registration here + self.model.dataChanged.connect(self.updateData) + rc = self.dialog.exec_() + self.model.dataChanged.disconnect() + return rc class JobTemplateExport: