From: srn Date: Tue, 20 Dec 2005 08:07:19 +0000 (+0000) Subject: BugID 9168, Changed the way of creation of GEOM_Engine, no it's stored in satatic... X-Git-Tag: V3_1_0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_3_1_0deb;p=modules%2Fgeom.git BugID 9168, Changed the way of creation of GEOM_Engine, no it's stored in satatic varibale, which is initialized only once --- 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() )