diff --git a/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx b/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx index 6e8455412..5066277c1 100644 --- a/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx +++ b/src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx @@ -118,8 +118,11 @@ bool GEOM_SelectionFilter::getShape (const GEOM::GEOM_Object_ptr& theObject, 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 ); diff --git a/src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx b/src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx index 5292daa07..f074982a9 100644 --- a/src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx +++ b/src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx @@ -45,8 +45,11 @@ static bool getShape( const GEOM::GEOM_Object_ptr& theObject, TopoDS_Shape& theS { 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() )