Skip to content

Commit

Permalink
Really delete processing dialogs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nyalldawson committed Jul 12, 2017
1 parent 77351fd commit 5c844a5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/plugins/processing/gui/AlgorithmLocatorFilter.py
Expand Up @@ -88,6 +88,9 @@ def triggerResult(self, result):
prevMapTool = canvas.mapTool()
dlg.show()
dlg.exec_()
# have to manually delete the dialog - otherwise it's owned by the
# iface mainWindow and never deleted
del dlg
if canvas.mapTool() != prevMapTool:
try:
canvas.mapTool().reset()
Expand Down
6 changes: 6 additions & 0 deletions python/plugins/processing/gui/ProcessingToolbox.py
Expand Up @@ -250,6 +250,9 @@ def executeAlgorithmAsBatchProcess(self):
dlg = BatchAlgorithmDialog(alg)
dlg.show()
dlg.exec_()
# have to manually delete the dialog - otherwise it's owned by the
# iface mainWindow and never deleted
del dlg

def executeAlgorithm(self):
item = self.algorithmTree.currentItem()
Expand Down Expand Up @@ -288,6 +291,9 @@ def executeAlgorithm(self):
ProcessingConfig.SHOW_RECENT_ALGORITHMS)
if showRecent:
self.addRecentAlgorithms(True)
# have to manually delete the dialog - otherwise it's owned by the
# iface mainWindow and never deleted
del dlg
else:
feedback = MessageBarProgress()
context = dataobjects.createContext(feedback)
Expand Down
4 changes: 4 additions & 0 deletions python/plugins/processing/gui/ScriptEditorDialog.py
Expand Up @@ -279,6 +279,10 @@ def runAlgorithm(self):
dlg.show()
dlg.exec_()

# have to manually delete the dialog - otherwise it's owned by the
# iface mainWindow and never deleted
del dlg

if canvas.mapTool() != prevMapTool:
try:
canvas.mapTool().reset()
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/gui/menus.py
Expand Up @@ -211,6 +211,9 @@ def _executeAlgorithm(alg):
prevMapTool = canvas.mapTool()
dlg.show()
dlg.exec_()
# have to manually delete the dialog - otherwise it's owned by the
# iface mainWindow and never deleted
del dlg
if canvas.mapTool() != prevMapTool:
try:
canvas.mapTool().reset()
Expand Down
3 changes: 3 additions & 0 deletions python/plugins/processing/modeler/ModelerDialog.py
Expand Up @@ -291,6 +291,9 @@ def runModel(self):

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

def save(self):
self.saveModel(False)
Expand Down

0 comments on commit 5c844a5

Please sign in to comment.