Commits

Yuya Nishihara committed 1ddf571

qtapp: fix cleanup of open repo and exception handler when no dialog open

Comments (0)

Files changed (1)

tortoisehg/hgqt/qtapp.py

         self._repomanager = thgrepo.RepoManager(ui, self)
 
         dlg, reporoot = self._createdialog(dlgfunc, args, opts)
-        if dlg:
-            dlg.show()
-            dlg.raise_()
-        else:
-            return -1
+        try:
+            if dlg:
+                dlg.show()
+                dlg.raise_()
+            else:
+                return -1
 
-        if thginithook is not None:
-            thginithook()
+            if thginithook is not None:
+                thginithook()
 
-        try:
             return self._mainapp.exec_()
         finally:
             if reporoot: