From 037b0157c9280803d0af8d1ca0618c2a42e83bb4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Krzysztof=20Kosi=C5=84ski?= Date: Thu, 18 Feb 2010 01:34:15 +0100 Subject: [PATCH] Fix node tool crash on path where the last subpath is a lone moveto --- src/ui/tool/path-manipulator.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui/tool/path-manipulator.cpp b/src/ui/tool/path-manipulator.cpp index 13f1448b9..82fe53440 100644 --- a/src/ui/tool/path-manipulator.cpp +++ b/src/ui/tool/path-manipulator.cpp @@ -923,8 +923,11 @@ void PathManipulator::_createControlPointsFromGeometry() // so that _updateDragPoint doesn't crash on paths with naked movetos Geom::PathVector pathv = pathv_to_linear_and_cubic_beziers(_spcurve->get_pathvector()); for (Geom::PathVector::iterator i = pathv.begin(); i != pathv.end(); ) { + // NOTE: this utilizes the fact that Geom::PathVector is an std::vector. + // When we erase an element, the next one slides into position, + // so we do not increment the iterator even though it is theoretically invalidated. if (i->empty()) { - pathv.erase(i++); + pathv.erase(i); } else { ++i; } -- 2.30.2