summaryrefslogtreecommitdiffstats
path: root/dimension
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2014-04-26 18:15:08 -0400
committerTavian Barnes <tavianator@tavianator.com>2014-04-26 18:15:08 -0400
commitcd9497d80611badcc6663572f849da52b19e3ec6 (patch)
treec6251a4aa03169c2b9f9e1bb400407266a8654c2 /dimension
parent46ab5e42be9b676242e3a7aef8748b08ac52a303 (diff)
downloaddimension-cd9497d80611badcc6663572f849da52b19e3ec6.tar.xz
preview: Handle ^C in more places.
Diffstat (limited to 'dimension')
-rw-r--r--dimension/preview.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/dimension/preview.py b/dimension/preview.py
index e4e9c80..aa4d032 100644
--- a/dimension/preview.py
+++ b/dimension/preview.py
@@ -57,11 +57,16 @@ class PreviewWindow(QtGui.QMainWindow):
@QtCore.pyqtSlot()
def update_preview(self):
- self.widget.updateGL()
- if self.future.is_done():
- self.render_timer.stop()
- self.close_timer = QtCore.QTimer(self)
- self.close_timer.singleShot(1000, self.close)
+ try:
+ self.widget.updateGL()
+ if self.future.is_done():
+ self.render_timer.stop()
+ self.close_timer = QtCore.QTimer(self)
+ self.close_timer.singleShot(1000, self.close)
+ except:
+ self.future.cancel()
+ self.close()
+ raise
@QtCore.pyqtSlot()
def close(self):