]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Task #3230: Sketcher: create a curve passing through selected points or vertices...
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 30 Jun 2020 11:02:16 +0000 (14:02 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Tue, 30 Jun 2020 11:02:16 +0000 (14:02 +0300)
Fix crash on reordering the list of points.

src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp

index 2ec8797c6662dc0f30f3a9ab4e1d4fa817f0f316..4e229efc0c399443ac528c8dccfee2337000555b 100644 (file)
@@ -186,6 +186,8 @@ void GeomAlgoAPI_CurveBuilder::reorderPoints(std::list<GeomPointPtr>& thePoints)
         // remove duplicates
         std::list<GeomPointPtr>::iterator aRemoveIt = aNextIt++;
         thePoints.erase(aRemoveIt);
+        // update iterator showing the nearest point, because it may become invalid
+        aNearestIt = aPIt; ++aNearestIt;
         continue;
       }
       if (aDist < aMinDist && (aMinDist - aDist) > Precision::Confusion()) {