make sure preview window is closed when browser closed

This commit is contained in:
Damien Elmes 2020-04-10 18:42:28 +10:00
parent 26f5b9250c
commit c964be3961

View File

@ -693,7 +693,7 @@ class Browser(QMainWindow):
evt.ignore() evt.ignore()
def _closeWindow(self): def _closeWindow(self):
self._cancelPreviewTimer() self._cleanup_preview()
self.editor.cleanup() self.editor.cleanup()
saveSplitter(self.form.splitter, "editor3") saveSplitter(self.form.splitter, "editor3")
saveGeom(self, "editor") saveGeom(self, "editor")
@ -1576,9 +1576,10 @@ where id in %s"""
if self._previewer: if self._previewer:
self._previewer.render_card(cardChanged) self._previewer.render_card(cardChanged)
def _cancelPreviewTimer(self): def _cleanup_preview(self):
if self._previewer: if self._previewer:
self._previewer.cancel_timer() self._previewer.cancel_timer()
self._previewer.close()
def _on_preview_closed(self): def _on_preview_closed(self):
self._previewer = None self._previewer = None