X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_Mesh.cxx;h=45d541b7a1a123b18a16a0612ba752660fd7ea98;hb=4ad6a5b19bae49eae5c02662e70c1229262cace5;hp=9416618c5c433325ec980dc4d6b39a5bdc6bd2df;hpb=fe663d61f64f1e7116438902e18e8779240967e3;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 9416618c5..45d541b7a 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -170,7 +170,10 @@ SMESH_Mesh::~SMESH_Mesh() // delete sub-meshes map ::iterator sm = _mapSubMesh.begin(); for ( ; sm != _mapSubMesh.end(); ++sm ) + { delete sm->second; + sm->second = 0; + } _mapSubMesh.clear(); if ( _rmGroupCallUp) delete _rmGroupCallUp; @@ -184,12 +187,24 @@ SMESH_Mesh::~SMESH_Mesh() } if ( _myDocument ) _myDocument->RemoveMesh( _id ); + _myDocument = 0; if ( _myMeshDS ) // delete _myMeshDS, in a thread in order not to block closing a study with large meshes boost::thread aThread(boost::bind( & deleteMeshDS, _myMeshDS )); } +//================================================================================ +/*! + * \brief Return true if a mesh with given id exists + */ +//================================================================================ + +bool SMESH_Mesh::MeshExists( int meshId ) const +{ + return _myDocument ? _myDocument->GetMesh( meshId ) : false; +} + //============================================================================= /*! * \brief Set geometry to be meshed