Commits

Yuya Nishihara committed 9103663

purge: disallow to close dialog while running

It causes segfault, "QThread: Destroyed while thread is still running".

  • Participants
  • Parent commits c45ec46
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/purge.py

         desktopgeom = qApp.desktop().availableGeometry()
         self.resize(desktopgeom.size() * 0.25)
         self.restoreGeometry(s.value('purge/geom').toByteArray())
+
+        self.th = None
         QTimer.singleShot(0, self.checkStatus)
 
     def checkStatus(self):
                 self.tcb.setEnabled(True)
 
     def reject(self):
+        if self.th and self.th.isRunning():
+            return
         s = QSettings()
         s.setValue('purge/geom', self.saveGeometry())
         super(PurgeDialog, self).reject()