]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/SMESHGUI/SMESHGUI_GroupOnShapeDlg.cxx
Salome HOME
Use GEOM_Object_var instead of GEOM_Object_wrap for obj returned by GetMainShape()
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_GroupOnShapeDlg.cxx
index 2b797a4219605c4cb8355cc8135ec076cd60efb6..e93d148e8c7d5a2948e00f81f5ef4116f0d68184 100644 (file)
@@ -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 );