mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-03-01 13:55:37 +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
|
//function : NewMesh
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
int SMESHDS_Document::NewMesh(bool theIsEmbeddedMode)
|
SMESHDS_Mesh * SMESHDS_Document::NewMesh(bool theIsEmbeddedMode, int MeshID)
|
||||||
{
|
{
|
||||||
static int aNewMeshID = 0;
|
std::map<int,SMESHDS_Mesh*>::iterator i_m =
|
||||||
aNewMeshID++;
|
myMeshes.insert( make_pair( MeshID, (SMESHDS_Mesh*)0 )).first;
|
||||||
SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(aNewMeshID,theIsEmbeddedMode);
|
if ( i_m->second )
|
||||||
myMeshes[aNewMeshID] = aNewMesh;
|
throw SALOME_Exception("SMESHDS_Document::NewMesh(): ID of existing mesh given");
|
||||||
return aNewMeshID;
|
SMESHDS_Mesh *aNewMesh = new SMESHDS_Mesh(MeshID,theIsEmbeddedMode);
|
||||||
|
i_m->second = aNewMesh;
|
||||||
|
return aNewMesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -39,7 +39,7 @@ class SMESHDS_EXPORT SMESHDS_Document
|
|||||||
public:
|
public:
|
||||||
SMESHDS_Document(int UserID);
|
SMESHDS_Document(int UserID);
|
||||||
~SMESHDS_Document();
|
~SMESHDS_Document();
|
||||||
int NewMesh(bool theIsEmbeddedMode);
|
SMESHDS_Mesh * NewMesh(bool theIsEmbeddedMode, int MeshID);
|
||||||
void RemoveMesh(int MeshID);
|
void RemoveMesh(int MeshID);
|
||||||
SMESHDS_Mesh * GetMesh(int MeshID);
|
SMESHDS_Mesh * GetMesh(int MeshID);
|
||||||
void AddHypothesis(SMESHDS_Hypothesis * H);
|
void AddHypothesis(SMESHDS_Hypothesis * H);
|
||||||
|
Loading…
Reference in New Issue
Block a user