PAL16774 (Crash after display of many groups)

implement destructor to free memory at closing a study
This commit is contained in:
eap 2007-11-07 09:28:28 +00:00
parent 1949fa0f3e
commit c9328ea212
2 changed files with 21 additions and 1 deletions

View File

@ -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 :

View File

@ -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;
}
//********************************************************************
//********************************************************************
//******** *********