diff --git a/ert_gui/main_window.py b/ert_gui/main_window.py index d517963ca4d..c2fa9cffd60 100644 --- a/ert_gui/main_window.py +++ b/ert_gui/main_window.py @@ -12,8 +12,6 @@ from ert_gui.about_dialog import AboutDialog from ert_shared.plugins import ErtPluginManager -import ert_shared - class GertMainWindow(QMainWindow): def __init__(self, config_file): @@ -101,14 +99,10 @@ def __saveSettings(self): settings.setValue("windowState", self.saveState()) - def _clear_global_state(self): - ert_shared.clear_global_state() - def closeEvent(self, event): #Use QT settings saving mechanism #settings stored in ~/.config/Equinor/ErtGui.conf self.__saveSettings() - self._clear_global_state() QMainWindow.closeEvent(self, event) diff --git a/ert_shared/main.py b/ert_shared/main.py index 1213d2e94b9..a2fc313ccf0 100644 --- a/ert_shared/main.py +++ b/ert_shared/main.py @@ -4,6 +4,7 @@ import sys import re from argparse import ArgumentParser, ArgumentTypeError +from ert_shared import clear_global_state from ert_shared.cli.main import run_cli from ert_gui.ide.keywords.definitions import ( RangeStringArgument, @@ -242,6 +243,8 @@ def main(): with ErtPluginContext(): args.func(args) + clear_global_state() + if __name__ == "__main__": main()