From: eap Date: Fri, 28 Dec 2012 11:38:13 +0000 (+0000) Subject: Use GEOM_Object_var instead of GEOM_Object_wrap for obj returned by GetMainShape() X-Git-Tag: pluginMGCleaner~205 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=08f731ecd6df2a7cc2c0f744a7fce73d438debea;p=modules%2Fsmesh.git Use GEOM_Object_var instead of GEOM_Object_wrap for obj returned by GetMainShape() --- diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index e7eccaee7..03ebc2731 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -1373,12 +1373,12 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); // The main shape of the group - GEOM::GEOM_Object_wrap aGroupMainShape; + GEOM::GEOM_Object_var aGroupMainShape; if (aGeomGroup->GetType() == 37) { GEOM::GEOM_IGroupOperations_wrap anOp = SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); aGroupMainShape = anOp->GetMainShape(aGeomGroup); - // aGroupMainShape is a new geom servant to be deleted by GEOM_Object_wrap + // aGroupMainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap } else { aGroupMainShape = aGeomGroup; diff --git a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx index 2b797a421..e93d148e8 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx @@ -227,8 +227,9 @@ static SMESH::ElementType elementType(GEOM::GEOM_Object_var geom) GEOM::GEOM_IGroupOperations_wrap aGroupOp = SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); if ( !aGroupOp->_is_nil() ) { - GEOM::GEOM_Object_wrap mainShape = aGroupOp->GetMainShape( geom ); - GEOM::ListOfLong_var ids = aGroupOp->GetObjects( geom ); + // mainShape is an existing servant => GEOM_Object_var not GEOM_Object_wrap + GEOM::GEOM_Object_var mainShape = aGroupOp->GetMainShape( geom ); + GEOM::ListOfLong_var ids = aGroupOp->GetObjects( geom ); if ( ids->length() && !mainShape->_is_nil() && !aShapeOp->_is_nil() ) { GEOM::GEOM_Object_wrap member = aShapeOp->GetSubShape( mainShape, ids[0] ); return elementType( member ); diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 00ad90ec5..9d9aa1c0c 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -354,7 +354,8 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const if (aSubGeomVar->_is_nil()) return false; // skl for NPAL14695 - implementation of searching of mainObj - GEOM::GEOM_Object_wrap mainObj = op->GetMainShape(aSubGeomVar); + GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); /* _var not _wrap as + mainObj already exists! */ while(1) { if (mainObj->_is_nil()) return false;