From: Krzysztof KosiƄski Date: Thu, 18 Feb 2010 00:34:15 +0000 (+0100) Subject: Fix node tool crash on path where the last subpath is a lone moveto X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=037b0157c9280803d0af8d1ca0618c2a42e83bb4;p=inkscape.git Fix node tool crash on path where the last subpath is a lone moveto --- 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; }