]> 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>
Thu, 2 Jul 2020 13:10:53 +0000 (16:10 +0300)
Fix crash on reordering the list of points.

src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp

index fd98f26af2eecd4b42648f26731a98f911352535..ab6499bf82bdbc10c5dbddaeaf8c7fa31fd87a7f 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()) {