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~60^2~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8be772f47d667b67c7567de1143e5d5080b13391;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 2ec8797c6..4e229efc0 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()) {