From: eap Date: Wed, 7 Nov 2007 09:28:28 +0000 (+0000) Subject: PAL16774 (Crash after display of many groups) X-Git-Tag: V4_1_0rc2~64 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=c9328ea212652efff9b48aaf2ec65e3575b88283;hp=1949fa0f3ec6dac7a1af935b60527903f314f2b7 PAL16774 (Crash after display of many groups) implement destructor to free memory at closing a study --- diff --git a/src/SMESHDS/SMESHDS_Document.cxx b/src/SMESHDS/SMESHDS_Document.cxx index 87fb9a0d4..815474d55 100644 --- a/src/SMESHDS/SMESHDS_Document.cxx +++ b/src/SMESHDS/SMESHDS_Document.cxx @@ -39,6 +39,18 @@ SMESHDS_Document::SMESHDS_Document(int UserID):myUserID(UserID) { } +//======================================================================= +//function : Destructor +//purpose : +//======================================================================= + +SMESHDS_Document::~SMESHDS_Document() +{ + InitMeshesIterator(); + while ( MoreMesh() ) + delete NextMesh(); +} + //======================================================================= //function : NewMesh //purpose : diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index 4e7561755..18b13fc5d 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -1220,13 +1220,21 @@ void SMESHDS_Mesh::SetMeshElementOnShape(const SMDS_MeshElement* anElement, add( anElement, getSubmesh( Index )); } +//======================================================================= +//function : ~SMESHDS_Mesh +//purpose : +//======================================================================= SMESHDS_Mesh::~SMESHDS_Mesh() { + // myScript delete myScript; + // submeshes + TShapeIndexToSubMesh::iterator i_sm = myShapeIndexToSubMesh.begin(); + for ( ; i_sm != myShapeIndexToSubMesh.end(); ++i_sm ) + delete i_sm->second; } - //******************************************************************** //******************************************************************** //******** *********