Skip to content

Commit

Permalink
close all external windows/enrichment results in MainWindow.closeEvent()
Browse files Browse the repository at this point in the history
  • Loading branch information
GuyTeichman committed Jan 1, 2024
1 parent ec0da94 commit 69cae8f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rnalysis/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -4257,6 +4257,7 @@ def closeEvent(self, event): # pragma: no cover
quit_msg, QtWidgets.QMessageBox.No, QtWidgets.QMessageBox.Yes)

if reply == QtWidgets.QMessageBox.Yes:
# quit job and STDOUT listener threads
try:
self.job_thread.quit()
except AttributeError:
Expand All @@ -4265,9 +4266,17 @@ def closeEvent(self, event): # pragma: no cover
self.thread_stdout_queue_listener.quit()
except AttributeError:
pass

# clear cache
io.clear_gui_cache()
plt.close('all')
# close all figures
self.close_figs_action.trigger()

# close all external windows
for window in itertools.chain(self.external_windows, self.enrichment_results):
window.close()
if self.error_window is not None:
self.error_window.close()

event.accept()
else:
event.ignore()
Expand Down

0 comments on commit 69cae8f

Please sign in to comment.