Salome HOME
0021480: EDF 2084 SMESH: SIGSEGV when validating Netgen3D hypothesis
authoreap <eap@opencascade.com>
Tue, 24 Jan 2012 13:00:47 +0000 (13:00 +0000)
committereap <eap@opencascade.com>
Tue, 24 Jan 2012 13:00:47 +0000 (13:00 +0000)
  In RemoveMesh(), do not erase an iterator pointing to map.end()

src/SMESHDS/SMESHDS_Document.cxx

index e27e747b1fb0ff5ac100d53dabd21fb88b3d788b..93441206302519c18b62920cabf0e0d2df1aaa83 100644 (file)
@@ -85,10 +85,9 @@ SMESHDS_Mesh *SMESHDS_Document::GetMesh(int MeshID)
 //=======================================================================
 void SMESHDS_Document::RemoveMesh(int MeshID)
 {
-        map<int,SMESHDS_Mesh*>::iterator it=myMeshes.find(MeshID);
-        if (it==myMeshes.end())
-                MESSAGE("SMESHDS_Document::RemoveMesh : ID not found"); 
-        myMeshes.erase(it);
+  map<int,SMESHDS_Mesh*>::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;
 }
 
 //=======================================================================