From: Artem Zhidkov Date: Tue, 30 Jun 2020 11:02:16 +0000 (+0300) Subject: Task #3230: Sketcher: create a curve passing through selected points or vertices... X-Git-Tag: V9_6_0a1~67 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2ca47c465924c4f9967bbc3938b3f44ef9bf6f41;p=modules%2Fshaper.git Task #3230: Sketcher: create a curve passing through selected points or vertices of a polyline Fix crash on reordering the list of points. --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp index fd98f26af..ab6499bf8 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp @@ -186,6 +186,8 @@ void GeomAlgoAPI_CurveBuilder::reorderPoints(std::list& thePoints) // remove duplicates std::list::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()) {