From 3fa4acc3ab827e053185d18b89fe47727bc0a68c Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 29 Sep 2009 14:11:58 +0000 Subject: [PATCH] Fix problem in Mesh module on closing study operation (reference to the non existent study is kept and used) --- src/SMESH_I/SMESH_Gen_i.cxx | 6 ++++++ src/SMESH_I/SMESH_Gen_i.hxx | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) 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 -- 2.39.2