VISU_Gen_i*
GetVisuGen(const CAM_Module* theModule)
{
- static VISU_Gen_i* aGen = NULL;
+ static VISU_Gen_i* aGen = 0;
if(!aGen){
SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService());
Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU");
VISU_Gen_var aVISU = VISU_Gen::_narrow(aComponent);
- if(!CORBA::is_nil(aVISU)){
- if((aGen = VISU_Gen_i::GetVisuGenImpl()))
- aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule))));
- }
+ if(!CORBA::is_nil(aVISU))
+ aGen = VISU_Gen_i::GetVisuGenImpl();
}
- if(!aGen)
+
+ if(aGen)
+ aGen->SetCurrentStudy(GetDSStudy(GetCStudy(GetAppStudy(theModule))));
+ else
throw std::runtime_error(QObject::tr("ERR_CANT_FIND_VISU_COMPONENT").toLatin1().data());
return aGen;
}
void
VISU_Gen_i
::Close(SALOMEDS::SComponent_ptr theComponent)
- {}
+ {
+ if ( !CORBA::is_nil( myStudyDocument ) && !CORBA::is_nil( theComponent ) &&
+ myStudyDocument->StudyId() == theComponent->GetStudy()->StudyId())
+ myStudyDocument = SALOMEDS::Study::_nil();
+ }
//---------------------------------------------------------------