Skip to content

Commit

Permalink
Do not free EnKFMain (the garbage collector will take car of that)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea Brambilla authored and Andrea Brambilla committed Feb 27, 2018
1 parent 89b6d3f commit 6ba9a8a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 28 deletions.
5 changes: 3 additions & 2 deletions python/python/ert_gui/ertnotifier.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from res.enkf import EnKFMain
from PyQt4.QtCore import QObject, pyqtSignal, pyqtSlot
from res.enkf import EnKFMain


class ErtNotifier(QObject):
ertChanged = pyqtSignal()
Expand Down Expand Up @@ -38,7 +39,7 @@ def reloadERT(self, config_file):
python_executable = sys.executable
ert_gui_main = sys.argv[0]

self._ert.free()
self._ert = None
os.execl(python_executable, python_executable, ert_gui_main, config_file)


Expand Down
15 changes: 5 additions & 10 deletions python/python/ert_gui/ertplot.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@

import sys
import os
from PyQt4.QtGui import QApplication
import time
from res.enkf import EnKFMain, ResConfig
from ecl.util.util import Version
from ert_gui.ert_splash import ErtSplash
from ert_gui.ertwidgets import resourceIcon
from ert_gui.tools.plot.plot_window import PlotWindow


import ert_gui.ertwidgets
from ert_gui.tools.plot.plot_window import PlotWindow
import os
from res.enkf import EnKFMain, ResConfig
import sys
import time

if os.getenv("ERT_SHARE_PATH"):
ert_share_path = os.getenv("ERT_SHARE_PATH")
Expand Down Expand Up @@ -70,9 +68,6 @@ def main(argv):
window.activateWindow()
window.raise_()
finished_code = app.exec_()

ert.free()

sys.exit(finished_code)


Expand Down
20 changes: 8 additions & 12 deletions python/python/ert_gui/gert_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,22 +110,15 @@
#
# -------------------- </Example shell script> --------------------

import os
import sys
import time

from PyQt4.QtCore import Qt
from PyQt4.QtGui import QApplication, QFileDialog

import ert_gui.ertwidgets
from ecl.util.util import EclVersion
from res.util import ResVersion
from res.enkf import EnKFMain, ResConfig
from res.util import ResLog
from ert_gui import ErtVersion
from ert_gui.ert_splash import ErtSplash
from ert_gui.ertwidgets import SummaryPanel, resourceIcon
import ert_gui.ertwidgets
from ert_gui.main_window import GertMainWindow
from ert_gui.newconfig import NewConfigurationDialog
from ert_gui.simulation.simulation_panel import SimulationPanel
from ert_gui.tools import HelpCenter
from ert_gui.tools.export import ExportTool
Expand All @@ -137,6 +130,12 @@
from ert_gui.tools.plugins import PluginHandler, PluginsTool
from ert_gui.tools.run_analysis import RunAnalysisTool
from ert_gui.tools.workflows import WorkflowsTool
import os
from res.enkf import EnKFMain, ResConfig
from res.util import ResLog
from res.util import ResVersion
import sys
import time

if os.getenv("ERT_SHARE_PATH"):
ert_share_path = os.getenv("ERT_SHARE_PATH")
Expand All @@ -149,7 +148,6 @@

ert_gui.ertwidgets.img_prefix = ert_share_path + "/gui/img/"

from ert_gui.newconfig import NewConfigurationDialog


def main(argv):
Expand Down Expand Up @@ -253,8 +251,6 @@ def main(argv):
window.raise_()
ResLog.log(3, "Versions ecl:%s res:%s ert:%s" % (EclVersion( ), ResVersion( ), ErtVersion( )))
finished_code = app.exec_()
ert.free()

sys.exit(finished_code)


Expand Down
4 changes: 0 additions & 4 deletions python/python/ert_gui/shell/ert_shell_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ def ert(self):

def setErt(self, ert):
""" @type ert: res.enkf.enkf_main.EnKFMain """
if self.__ert is not None and self.__ert != ert:
self.__ert.free()
self.__ert = None

self.__ert = ert

@property
Expand Down

0 comments on commit 6ba9a8a

Please sign in to comment.