0021375: EDF 1671 SMESH: Dump study of current state

+  bool MeshExists( int meshId ) const;
     used to avoid crash at deletion of SMESH_subMesh::myOwnListeners
     at mesh removal
This commit is contained in:
eap 2012-02-09 13:10:52 +00:00
parent d3c66835d0
commit 14e44c7736
2 changed files with 17 additions and 0 deletions

View File

@ -170,7 +170,10 @@ SMESH_Mesh::~SMESH_Mesh()
// delete sub-meshes
map <int, SMESH_subMesh*>::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

View File

@ -147,6 +147,8 @@ public:
int GetId() const { return _id; }
bool MeshExists( int meshId ) const;
SMESHDS_Mesh * GetMeshDS() { return _myMeshDS; }
const SMESHDS_Mesh * GetMeshDS() const { return _myMeshDS; }