diff --git a/python/mmSolver/ui/base_maya_window.py b/python/mmSolver/ui/base_maya_window.py index a44859203..8af8193fd 100644 --- a/python/mmSolver/ui/base_maya_window.py +++ b/python/mmSolver/ui/base_maya_window.py @@ -61,6 +61,7 @@ def apply(self): LOG = mmSolver.logger.get_logger() +ALL_CLASS_INSTANCES = set() class BaseMayaWindow(MayaQWidgetDockableMixin, @@ -75,6 +76,9 @@ def __init__(self, parent, name=None): super(BaseMayaWindow, self).__init__() self.windowGeometry = None + global ALL_CLASS_INSTANCES + ALL_CLASS_INSTANCES.add(self) + # Destroy this widget when closed. Otherwise it will stay around. self.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)