From: eap Date: Tue, 24 Jan 2012 13:00:47 +0000 (+0000) Subject: 0021480: EDF 2084 SMESH: SIGSEGV when validating Netgen3D hypothesis X-Git-Tag: V6_5_0a1~180 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6a0dd162a9787d5594f306995f7e3a0ece456f39;p=modules%2Fsmesh.git 0021480: EDF 2084 SMESH: SIGSEGV when validating Netgen3D hypothesis In RemoveMesh(), do not erase an iterator pointing to map.end() --- diff --git a/src/SMESHDS/SMESHDS_Document.cxx b/src/SMESHDS/SMESHDS_Document.cxx index e27e747b1..934412063 100644 --- a/src/SMESHDS/SMESHDS_Document.cxx +++ b/src/SMESHDS/SMESHDS_Document.cxx @@ -85,10 +85,9 @@ SMESHDS_Mesh *SMESHDS_Document::GetMesh(int MeshID) //======================================================================= void SMESHDS_Document::RemoveMesh(int MeshID) { - map::iterator it=myMeshes.find(MeshID); - if (it==myMeshes.end()) - MESSAGE("SMESHDS_Document::RemoveMesh : ID not found"); - myMeshes.erase(it); + map::iterator it=myMeshes.find(MeshID); + if (it!=myMeshes.end()) + myMeshes.erase(it); } //======================================================================= @@ -97,7 +96,7 @@ void SMESHDS_Document::RemoveMesh(int MeshID) //======================================================================= void SMESHDS_Document::AddHypothesis(SMESHDS_Hypothesis * H) { - myHypothesis[H->GetID()]=H; + myHypothesis[H->GetID()]=H; } //=======================================================================