From: eap Date: Thu, 25 Jul 2013 09:00:54 +0000 (+0000) Subject: 22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs X-Git-Tag: V7_3_0a1~247 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d50d49340805031683cb39056d788b5ece30a1c4;p=modules%2Fsmesh.git 22261: EDF 2698 SMESH: Memory leak when displaying 2D quadratic elements as arcs In createSubMesh() fix getting a sub-mesh ID for a a sub-mesh on group --- diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 979a572ad..735ab2ef7 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -2120,10 +2120,10 @@ SMESH::SMESH_Group_ptr SMESH_Mesh_i::ConvertToStandalone( SMESH::SMESH_GroupBase SMESH::SMESH_subMesh_ptr SMESH_Mesh_i::createSubMesh( GEOM::GEOM_Object_ptr theSubShapeObject ) { if(MYDEBUG) MESSAGE( "createSubMesh" ); - TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject); - const int subMeshId = _impl->GetMeshDS()->ShapeToIndex( myLocSubShape ); + TopoDS_Shape myLocSubShape = _gen_i->GeomObjectToShape(theSubShapeObject); + ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape); + const int subMeshId = mySubMesh->GetId(); - ::SMESH_subMesh * mySubMesh = _impl->GetSubMesh(myLocSubShape); SMESH_subMesh_i * subMeshServant = new SMESH_subMesh_i(myPOA, _gen_i, this, subMeshId); SMESH::SMESH_subMesh_var subMesh = subMeshServant->_this();