Add try/finally for every setOverrideCursor/restoreOverrideCursor.
[bertos.git] / wizard / BToolchainPage.py
index 6239a1d9dd0f1fa9503185b2428a272dde643452..88be219efe4a323743437ac06a47f124054f90b3 100644 (file)
@@ -155,10 +155,12 @@ class BToolchainPage(BWizardPage):
         Slot called when the user clicks on the validate button. It starts the
         toolchain validation procedure for all the toolchains.
         """
         Slot called when the user clicks on the validate button. It starts the
         toolchain validation procedure for all the toolchains.
         """
-        QApplication.instance().setOverrideCursor(Qt.WaitCursor)
-        for i in range(self.pageContent.toolchainList.count()):
-            self.validateToolchain(i)
-        QApplication.instance().restoreOverrideCursor()
+        try:
+            QApplication.instance().setOverrideCursor(Qt.WaitCursor)
+            for i in range(self.pageContent.toolchainList.count()):
+                self.validateToolchain(i)
+        finally:
+            QApplication.instance().restoreOverrideCursor()
 
     ####
 
 
     ####