mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-01 10:45:36 +05:00
21948: EDF SMESH : Memory is not freed when deleting a mesh
- int NewMesh(bool theIsEmbeddedMode); + SMESHDS_Mesh * NewMesh(bool theIsEmbeddedMode, int MeshID);
This commit is contained in:
parent
b22f68bd44
commit
ee35ac825c
@ -55,13 +55,15 @@ SMESHDS_Document::~SMESHDS_Document()
|
||||
//function : NewMesh
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
int SMESHDS_Document::NewMesh(bool theIsEmbeddedMode)
|
||||
SMESHDS_Mesh * SMESHDS_Document::NewMesh(bool theIsEmbeddedMode, int MeshID)
|
||||
{
|
||||
static int aNewMeshID = 0;
|
||||
aNewMeshID++;
|
||||
SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(aNewMeshID,theIsEmbeddedMode);
|
||||
myMeshes[aNewMeshID] = aNewMesh;
|
||||
return aNewMeshID;
|
||||
std::map<int,SMESHDS_Mesh*>::iterator i_m =
|
||||
myMeshes.insert( make_pair( MeshID, (SMESHDS_Mesh*)0 )).first;
|
||||
if ( i_m->second )
|
||||
throw SALOME_Exception("SMESHDS_Document::NewMesh(): ID of existing mesh given");
|
||||
SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(MeshID,theIsEmbeddedMode);
|
||||
i_m->second = aNewMesh;
|
||||
return aNewMesh;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@ -38,8 +38,8 @@ class SMESHDS_EXPORT SMESHDS_Document
|
||||
{
|
||||
public:
|
||||
SMESHDS_Document(int UserID);
|
||||
~SMESHDS_Document();
|
||||
int NewMesh(bool theIsEmbeddedMode);
|
||||
~SMESHDS_Document();
|
||||
SMESHDS_Mesh * NewMesh(bool theIsEmbeddedMode, int MeshID);
|
||||
void RemoveMesh(int MeshID);
|
||||
SMESHDS_Mesh * GetMesh(int MeshID);
|
||||
void AddHypothesis(SMESHDS_Hypothesis * H);
|
||||
|
Loading…
Reference in New Issue
Block a user