diff --git a/src/mslice/plotting/globalfiguremanager.py b/src/mslice/plotting/globalfiguremanager.py index 2d19aae6..fca1d067 100644 --- a/src/mslice/plotting/globalfiguremanager.py +++ b/src/mslice/plotting/globalfiguremanager.py @@ -186,6 +186,7 @@ def destroy_all(cls): } cls._activeQue = [] cls._figures.clear() + cls.observers = [] @classmethod def has_fignum(cls, num): diff --git a/tests/app_test.py b/tests/app_test.py index 347a3e61..64e8c42d 100644 --- a/tests/app_test.py +++ b/tests/app_test.py @@ -3,6 +3,7 @@ import unittest from mock import patch from mslice.app.mainwindow import MainWindow +from mslice.plotting.globalfiguremanager import GlobalFigureManager qapp = None @@ -15,6 +16,8 @@ def setUp(self): qapp = QtWidgets.QApplication([' ']) def tearDown(self): + GlobalFigureManager.destroy_all() + # Required to sendPostedEvents twice to ensure the MainWindow is deleted qapp.sendPostedEvents() qapp.sendPostedEvents()