//=============================================================================
void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
+{
+ setCurrentStudy( theStudy );
+}
+
+void SMESH_Gen_i::setCurrentStudy( SALOMEDS::Study_ptr theStudy,
+ bool theStudyIsBeingClosed)
{
int curStudyId = GetCurrentStudyID();
myCurrentStudy = SALOMEDS::Study::_duplicate( theStudy );
}
// myCurrentStudy may be nil
- if ( !CORBA::is_nil( myCurrentStudy ) ) {
+ if ( !theStudyIsBeingClosed && !CORBA::is_nil( myCurrentStudy ) ) {
SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() );
// set correct current study
SALOMEDS::Study_var study = theComponent->GetStudy();
if ( study->StudyId() != GetCurrentStudyID())
- SetCurrentStudy( study );
+ setCurrentStudy( study, /*IsBeingClosed=*/true );
// Clear study contexts data
int studyId = GetCurrentStudyID();
const char* theCommandNameForPython,
const char* theFileNameForPython);
+ void setCurrentStudy( SALOMEDS::Study_ptr theStudy,
+ bool theStudyIsBeingClosed=false);
+
private:
static GEOM::GEOM_Gen_var myGeomGen;
static CORBA::ORB_var myOrb; // ORB reference