diff --git a/apps/vaporgui/PythonVariables.cpp b/apps/vaporgui/PythonVariables.cpp index 762fdb37ca..d312ff113b 100644 --- a/apps/vaporgui/PythonVariables.cpp +++ b/apps/vaporgui/PythonVariables.cpp @@ -107,7 +107,10 @@ PythonVariables::~PythonVariables() void PythonVariables::Update(bool internalUpdate) { - if ((_scriptName == "") || (_dataMgrName == "")) { + VAPoR::DataStatus * dataStatus = _controlExec->GetDataStatus(); + std::vector dataMgrNames = dataStatus->GetDataMgrNames(); + + if ((_scriptName == "") || (_dataMgrName == "") || ((std::find(dataMgrNames.begin(), dataMgrNames.end(), _dataMgrName) == dataMgrNames.end()))) { _reset(); _setGUIEnabled(false); } else { diff --git a/include/vapor/CalcEngineMgr.h b/include/vapor/CalcEngineMgr.h index 34b5b3e88c..315f46961a 100644 --- a/include/vapor/CalcEngineMgr.h +++ b/include/vapor/CalcEngineMgr.h @@ -50,6 +50,11 @@ class RENDER_API CalcEngineMgr : public Wasp::MyBase { // void ReinitFromState() { _sync(); } + //! Remove all functions added with AddFunction() + //! + //! \sa AddFunction() + void Clean() { _clean(); } + private: const DataStatus *_dataStatus; const ParamsMgr * _paramsMgr; diff --git a/lib/render/ControlExecutive.cpp b/lib/render/ControlExecutive.cpp index 721d7f9898..8362017df7 100644 --- a/lib/render/ControlExecutive.cpp +++ b/lib/render/ControlExecutive.cpp @@ -458,6 +458,7 @@ int ControlExec::OpenData(const std::vector &files, const std::vectorGetDataMgr(dataSetName)) { + _calcEngineMgr->Clean(); _dataStatus->Close(dataSetName); vector vizNames = _paramsMgr->GetVisualizerNames(); @@ -488,6 +489,7 @@ int ControlExec::OpenData(const std::vector &files, const std::vectorInitialize(); if (rc < 0) { + _calcEngineMgr->Clean(); _dataStatus->Close(dataSetName); _paramsMgr->RemoveDataMgr(dataSetName); SetErrMsg("Failure to initialize application renderer \"%s\"", appRenderParams[i]->GetName().c_str()); @@ -530,11 +532,7 @@ void ControlExec::CloseData(string dataSetName) _paramsMgr->RemoveDataMgr(dataSetName); - // Rebuild the calculation engine from params database after removing - // the data set from the params database. - // - _calcEngineMgr->ReinitFromState(); - + _calcEngineMgr->Clean(); _dataStatus->Close(dataSetName); UndoRedoClear();