summaryrefslogtreecommitdiffstats
path: root/src/ui/tool/path-manipulator.cpp
diff options
context:
space:
mode:
authorKrzysztof Kosi??ski <tweenk.pl@gmail.com>2010-02-18 00:34:15 +0000
committerKrzysztof KosiƄski <tweenk.pl@gmail.com>2010-02-18 00:34:15 +0000
commit64175d46a59752af36075fb07cfb0b526b159b7b (patch)
treec69b15ba28990dd28bdb686616f8cdaa089ebb6a /src/ui/tool/path-manipulator.cpp
parentMake ControlPointSelection trackable to prevent random crashes (diff)
downloadinkscape-64175d46a59752af36075fb07cfb0b526b159b7b.tar.gz
inkscape-64175d46a59752af36075fb07cfb0b526b159b7b.zip
Fix node tool crash on path where the last subpath is a lone moveto
(bzr r9096)
Diffstat (limited to 'src/ui/tool/path-manipulator.cpp')
-rw-r--r--src/ui/tool/path-manipulator.cpp5
1 files changed, 4 insertions, 1 deletions
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;
}