fix bug 12361. Peview possiblity of SetCurrentStudy(nil)

This commit is contained in:
eap 2006-05-10 12:49:13 +00:00
parent 850cf38bd9
commit fdfe9f0f65

View File

@ -456,6 +456,8 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
myStudyContextMap[ studyId ] = new StudyContext; myStudyContextMap[ studyId ] = new StudyContext;
} }
// myCurrentStudy may be nil
if ( !CORBA::is_nil( myCurrentStudy ) ) {
SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder(); SALOMEDS::StudyBuilder_var aStudyBuilder = myCurrentStudy->NewBuilder();
if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() ) if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() )
aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() ); aStudyBuilder->LoadWith( myCurrentStudy->FindComponent( "GEOM" ), GetGeomEngine() );
@ -463,6 +465,7 @@ void SMESH_Gen_i::SetCurrentStudy( SALOMEDS::Study_ptr theStudy )
// set current study for geom engine // set current study for geom engine
//if ( !CORBA::is_nil( GetGeomEngine() ) ) //if ( !CORBA::is_nil( GetGeomEngine() ) )
// GetGeomEngine()->GetCurrentStudy( myCurrentStudy->StudyId() ); // GetGeomEngine()->GetCurrentStudy( myCurrentStudy->StudyId() );
}
} }
//============================================================================= //=============================================================================