diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 0f4dd5407..882a932ff 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -270,6 +270,16 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) if (geomClient->Find(S, aIOR)) { geomClient->RemoveShapeFromBuffer(aIOR); } + // clear buffer also for sub-groups + const std::set& groups = _impl->GetMeshDS()->GetGroups(); + std::set::const_iterator g = groups.begin(); + for (; g != groups.end(); ++g) + if (const SMESHDS_GroupOnGeom* group = dynamic_cast(*g)) + { + const TopoDS_Shape& s = group->GetShape(); + if (geomClient->Find(s, aIOR)) + geomClient->RemoveShapeFromBuffer(aIOR); + } // update the reference to theNewGeom (needed for correct execution of a dumped python script) SMESH::SMESH_Mesh_var me = _this();