0021480: EDF 2084 SMESH: SIGSEGV when validating Netgen3D hypothesis

In RemoveMesh(), do not erase an iterator pointing to map.end()
This commit is contained in:
eap 2012-01-24 13:00:47 +00:00
parent fe663d61f6
commit 6a0dd162a9

View File

@ -85,10 +85,9 @@ SMESHDS_Mesh *SMESHDS_Document::GetMesh(int MeshID)
//======================================================================= //=======================================================================
void SMESHDS_Document::RemoveMesh(int MeshID) void SMESHDS_Document::RemoveMesh(int MeshID)
{ {
map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID); map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
if (it==myMeshes.end()) if (it!=myMeshes.end())
MESSAGE("SMESHDS_Document::RemoveMesh : ID not found"); myMeshes.erase(it);
myMeshes.erase(it);
} }
//======================================================================= //=======================================================================
@ -97,7 +96,7 @@ void SMESHDS_Document::RemoveMesh(int MeshID)
//======================================================================= //=======================================================================
void SMESHDS_Document::AddHypothesis(SMESHDS_Hypothesis * H) void SMESHDS_Document::AddHypothesis(SMESHDS_Hypothesis * H)
{ {
myHypothesis[H->GetID()]=H; myHypothesis[H->GetID()]=H;
} }
//======================================================================= //=======================================================================