if ( app )
{
SALOME_LifeCycleCORBA* ls = new SALOME_LifeCycleCORBA( app->namingService() );
- Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
- GEOM::GEOM_Gen_var geomGen = GEOM::GEOM_Gen::_narrow( comp );
+ static GEOM::GEOM_Gen_var geomGen;
+ if(CORBA::is_nil( geomGen )) {
+ Engines::Component_var comp = ls->FindOrLoad_Component( "FactoryServer", "GEOM" );
+ geomGen = GEOM::GEOM_Gen::_narrow( comp );
+ }
if ( !CORBA::is_nil( geomGen ) )
{
TopoDS_Shape aTopoDSShape = GEOM_Client().GetShape( geomGen, theObject );
{
if ( !CORBA::is_nil( theObject ) )
{
- Engines::Component_var comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", "GEOM" );
- GEOM::GEOM_Gen_var myGeom = GEOM::GEOM_Gen::_narrow( comp );
+ static GEOM::GEOM_Gen_var myGeom;
+ if(CORBA::is_nil(myGeom) {
+ Engines::Component_var comp = QAD_Application::getDesktop()->getEngine( "FactoryServer", "GEOM" );
+ myGeom = GEOM::GEOM_Gen::_narrow( comp );
+ }
TopoDS_Shape aTopoDSShape = GEOM_Client().GetShape( myGeom, theObject );
if ( !aTopoDSShape.IsNull() )