Skip to content

Commit 5c844a5

Browse files
committed
Really delete processing dialogs
The dialogs are parented to the main window, which means sip transfers the ownership to the main window - and they are never deleted as a result. This results in various error messages caused by the widgets hanging around forever and listening out for various signals they are connected to.
1 parent 77351fd commit 5c844a5

File tree

5 files changed

+19
-0
lines changed

5 files changed

+19
-0
lines changed

python/plugins/processing/gui/AlgorithmLocatorFilter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def triggerResult(self, result):
8888
prevMapTool = canvas.mapTool()
8989
dlg.show()
9090
dlg.exec_()
91+
# have to manually delete the dialog - otherwise it's owned by the
92+
# iface mainWindow and never deleted
93+
del dlg
9194
if canvas.mapTool() != prevMapTool:
9295
try:
9396
canvas.mapTool().reset()

python/plugins/processing/gui/ProcessingToolbox.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ def executeAlgorithmAsBatchProcess(self):
250250
dlg = BatchAlgorithmDialog(alg)
251251
dlg.show()
252252
dlg.exec_()
253+
# have to manually delete the dialog - otherwise it's owned by the
254+
# iface mainWindow and never deleted
255+
del dlg
253256

254257
def executeAlgorithm(self):
255258
item = self.algorithmTree.currentItem()
@@ -288,6 +291,9 @@ def executeAlgorithm(self):
288291
ProcessingConfig.SHOW_RECENT_ALGORITHMS)
289292
if showRecent:
290293
self.addRecentAlgorithms(True)
294+
# have to manually delete the dialog - otherwise it's owned by the
295+
# iface mainWindow and never deleted
296+
del dlg
291297
else:
292298
feedback = MessageBarProgress()
293299
context = dataobjects.createContext(feedback)

python/plugins/processing/gui/ScriptEditorDialog.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@ def runAlgorithm(self):
279279
dlg.show()
280280
dlg.exec_()
281281

282+
# have to manually delete the dialog - otherwise it's owned by the
283+
# iface mainWindow and never deleted
284+
del dlg
285+
282286
if canvas.mapTool() != prevMapTool:
283287
try:
284288
canvas.mapTool().reset()

python/plugins/processing/gui/menus.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ def _executeAlgorithm(alg):
211211
prevMapTool = canvas.mapTool()
212212
dlg.show()
213213
dlg.exec_()
214+
# have to manually delete the dialog - otherwise it's owned by the
215+
# iface mainWindow and never deleted
216+
del dlg
214217
if canvas.mapTool() != prevMapTool:
215218
try:
216219
canvas.mapTool().reset()

python/plugins/processing/modeler/ModelerDialog.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ def runModel(self):
291291

292292
dlg = AlgorithmDialog(self.model)
293293
dlg.exec_()
294+
# have to manually delete the dialog - otherwise it's owned by the
295+
# iface mainWindow and never deleted
296+
del dlg
294297

295298
def save(self):
296299
self.saveModel(False)

0 commit comments

Comments
 (0)