Skip to content

Commit

Permalink
clear_global_state() outside of Qt
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkwah authored and markusdregi committed Nov 15, 2019
1 parent 11f6e08 commit e5bdd52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 0 additions & 6 deletions ert_gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)


Expand Down
3 changes: 3 additions & 0 deletions ert_shared/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -242,6 +243,8 @@ def main():
with ErtPluginContext():
args.func(args)

clear_global_state()


if __name__ == "__main__":
main()

0 comments on commit e5bdd52

Please sign in to comment.