Skip to content

Commit

Permalink
Ensure observers in GlobalFigureManager are destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
robertapplin committed Aug 14, 2023
1 parent 924f36c commit d1d3d3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/mslice/plotting/globalfiguremanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ def destroy_all(cls):
}
cls._activeQue = []
cls._figures.clear()
cls.observers = []

@classmethod
def has_fignum(cls, num):
Expand Down
3 changes: 3 additions & 0 deletions tests/app_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import unittest
from mock import patch
from mslice.app.mainwindow import MainWindow
from mslice.plotting.globalfiguremanager import GlobalFigureManager

qapp = None

Expand All @@ -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()
Expand Down

0 comments on commit d1d3d3d

Please sign in to comment.