Skip to content
Permalink
Browse files

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.
  • Loading branch information
nyalldawson committed Jul 12, 2017
1 parent 77351fd commit 5c844a5cfb22de57c89eb85300f8d6b96ffbadb3
@@ -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()
@@ -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()
@@ -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)
@@ -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()
@@ -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()
@@ -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)

0 comments on commit 5c844a5

Please sign in to comment.
You can’t perform that action at this time.