mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-15 10:08:34 +05:00
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:
parent
d3c66835d0
commit
14e44c7736
@ -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
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user