summaryrefslogtreecommitdiffstats
path: root/dimension/preview.py
diff options
context:
space:
mode:
Diffstat (limited to 'dimension/preview.py')
-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):