diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 514eb9380..dbf4fe43e 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -4195,6 +4195,7 @@ void SMESH_Gen_i::Close( SALOMEDS::SComponent_ptr theComponent ) // context->myDocument = 0; // } + myCurrentStudy = SALOMEDS::Study::_nil(); return; } @@ -4316,6 +4317,11 @@ void SMESH_Gen_i::SetName(const char* theIOR, } } +int SMESH_Gen_i::GetCurrentStudyID() +{ + return myCurrentStudy->_is_nil() || myCurrentStudy->_non_existent() ? -1 : myCurrentStudy->StudyId(); +} + //============================================================================= /*! * SMESHEngine_factory diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 9ba9bdbb9..0a6e01061 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -498,8 +498,7 @@ public: } // Get current study ID - int GetCurrentStudyID() - { return myCurrentStudy->_is_nil() ? -1 : myCurrentStudy->StudyId(); } + int GetCurrentStudyID(); /*! * \brief Find SObject for an algo