_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;
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 );
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;