1. TortoiseHg
  2. TortoiseHg
  3. thg

Commits

Yuya Nishihara  committed 070c781

qdelete: move finished slot to instance which avoids reference cycle

Now QDeleteDialog can be deleted by refcount.

  • Participants
  • Parent commits fd5e0af
  • Branches default

Comments (0)

Files changed (3)

File tortoisehg/hgqt/mq.py

View file
         from tortoisehg.hgqt import qdelete
         patch = self.queueListWidget.currentItem()._thgpatch
         dlg = qdelete.QDeleteDialog(self.repo, [patch], self)
-        dlg.finished.connect(dlg.deleteLater)
         if dlg.exec_() == QDialog.Accepted:
             self.reload()
 

File tortoisehg/hgqt/qdelete.py

View file
         self.bbox = bbox
 
     def accept(self):
-        def finished(ret):
-            self.repo.decrementBusyCount()
-            self.reject()
         cmdline = ['qdelete', '--repository', self.repo.root]
         if self.keepchk.isChecked():
             cmdline += ['--keep']
         cmdline += self.patches
         self.repo.incrementBusyCount()
-        self.cmd.commandFinished.connect(finished)
+        self.cmd.commandFinished.connect(self._finishOff)
         self.cmd.run(cmdline)
+
+    @pyqtSlot()
+    def _finishOff(self):
+        self.repo.decrementBusyCount()
+        self.reject()

File tortoisehg/hgqt/repowidget.py

View file
         def qdeleteact():
             """Delete unapplied patch(es)"""
             dlg = qdelete.QDeleteDialog(self.repo, self.menuselection, self)
-            dlg.finished.connect(dlg.deleteLater)
             dlg.output.connect(self.output)
             dlg.makeLogVisible.connect(self.makeLogVisible)
             dlg.exec_()