From: jfa Date: Tue, 2 May 2006 06:51:24 +0000 (+0000) Subject: Fix bug 12290: Exception in Mesh when creating a group on geometry while Geometry... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8b2c58b0d15ad2b9253a177e7797232fa74ad7f6;p=modules%2Fgeom.git Fix bug 12290: Exception in Mesh when creating a group on geometry while Geometry module was not activated. --- diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index f113bc8f0..31c711744 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -77,16 +77,22 @@ extern "C" { -GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil(); +GEOM::GEOM_Gen_var GeometryGUI::myComponentGeom = GEOM::GEOM_Gen::_nil(); -GEOM::GEOM_Gen_var GeometryGUI::GetGeomGen() { return GeometryGUI::myComponentGeom; } +GEOM::GEOM_Gen_var GeometryGUI::GetGeomGen() +{ + // Bug 12290: exception in Mesh GUI on GEOMBase::GetShape() if Geometry GUI hasn't been loaded + if (CORBA::is_nil(myComponentGeom)) + InitGeomGen(); + return GeometryGUI::myComponentGeom; +} -bool GeometryGUI::InitGeomGen() +bool GeometryGUI::InitGeomGen() { GeometryGUI aGG; - if( CORBA::is_nil( myComponentGeom ) ) return false; - return true; -} + if( CORBA::is_nil( myComponentGeom ) ) return false; + return true; +} //======================================================================= // function : ClientSObjectToObject