diff --git a/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx b/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx
index 9ec6e90..ba9d348 100644
--- a/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx
+++ b/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx
@@ -79,6 +79,7 @@
 #include <TColStd_MapOfInteger.hxx>
 #include <SortTools_ShellSortOfReal.hxx>
 #include <TCollection_CompareOfReal.hxx>
+#include <vector>
 
 static Standard_Integer LIMITE_TRIANGULATION = 1048576;
 
@@ -443,8 +444,12 @@ void BRepMesh_FastDiscret::Add(const TopoDS_Face& theface)
         
         //clear the structure of links
         const MeshDS_MapOfInteger& aLinks = structure->LinkOfDomain(nbDomains);
+        std::vector<int> toRemove;
         for(MeshDS_MapOfInteger::Iterator anIter(aLinks);anIter.More();anIter.Next())
-          structure->ForseRemoveLink(anIter.Key());
+            toRemove.push_back(anIter.Key());
+        for(i = 0; i < toRemove.size(); i++)
+            structure->ForseRemoveLink(toRemove[i]);
+
         for (i = 1; i <= myvemap.Extent(); i++)
            structure->ForseRemoveNode(myvemap.FindKey(i));
         

diff --git a/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx b/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx
index 9ec6e90..9dc10bc 100644
--- a/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx
+++ b/ros/src/BRepMesh/BRepMesh_FastDiscret.cxx
@@ -443,8 +443,11 @@ void BRepMesh_FastDiscret::Add(const TopoDS_Face& theface)
         
         //clear the structure of links
         const MeshDS_MapOfInteger& aLinks = structure->LinkOfDomain(nbDomains);
+        TColStd_SequenceOfInteger toRemove;
         for(MeshDS_MapOfInteger::Iterator anIter(aLinks);anIter.More();anIter.Next())
-          structure->ForseRemoveLink(anIter.Key());
+          toRemove.Append(anIter.Key());
+        for (i = 1; i <= toRemove.Length(); i++)
+          structure->ForseRemoveLink(toRemove.Value(i));
         for (i = 1; i <= myvemap.Extent(); i++)
            structure->ForseRemoveNode(myvemap.FindKey(i));
         

Make BRepMesh_FastDiscret patch more "Opencascade friendly".
Make BRepMesh_FastDiscret patch more "Opencascade friendly".

http://git.debian.org/?p=debian-science/packages/opencascade.git;h=e86ccf315508f15bb31d6aface51d5f24cc8c131
