From 957bbeb9e8ebeff04ec62c82cc00e3a3b8780568 Mon Sep 17 00:00:00 2001 From: srn Date: Tue, 20 Dec 2005 08:07:19 +0000 Subject: [PATCH] BugID 9168, Changed the way of creation of GEOM_Engine, no it's stored in satatic varibale, which is initialized only once --- src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx | 7 +++++-- src/GEOMFiltersSelection/GEOM_ShapeTypeFilter.cxx | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) 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() ) -- 2.39.2