summaryrefslogtreecommitdiffstats
path: root/src/ui/tool
diff options
context:
space:
mode:
authorJabiertxof <jtx@jtx>2017-03-16 19:08:44 +0000
committerJabiertxof <jtx@jtx>2017-03-16 19:08:44 +0000
commit8330d0ef2b97c73121ead78ea9fbcec6ee01f879 (patch)
tree1b1717d1706ee6ebfecc800f2cc80430eb0450e0 /src/ui/tool
parentupdate to trunk (diff)
parentFix rendering when canvas rotated. General code clean-up and documentation. (diff)
downloadinkscape-8330d0ef2b97c73121ead78ea9fbcec6ee01f879.tar.gz
inkscape-8330d0ef2b97c73121ead78ea9fbcec6ee01f879.zip
Update to trunk
(bzr r13645.1.170)
Diffstat (limited to 'src/ui/tool')
-rw-r--r--src/ui/tool/multi-path-manipulator.h15
-rw-r--r--src/ui/tool/node.h5
2 files changed, 13 insertions, 7 deletions
diff --git a/src/ui/tool/multi-path-manipulator.h b/src/ui/tool/multi-path-manipulator.h
index c908cede2..4f152e0a2 100644
--- a/src/ui/tool/multi-path-manipulator.h
+++ b/src/ui/tool/multi-path-manipulator.h
@@ -82,8 +82,19 @@ private:
template <typename R>
void invokeForAll(R (PathManipulator::*method)()) {
- for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ++i) {
- ((i->second.get())->*method)();
+ for (MapType::iterator i = _mmap.begin(); i != _mmap.end(); ) {
+ // Sometimes the PathManipulator got freed at loop end, thus
+ // invalidating the iterator so make sure that next_i will
+ // be a valid iterator and then assign i to it.
+ MapType::iterator next_i = i;
+ ++next_i;
+ // i->second is a boost::shared_ptr so try to hold on to it so
+ // it won't get freed prematurely by the WriteXML() method or
+ // whatever. See https://bugs.launchpad.net/inkscape/+bug/1617615
+ // Applicable to empty paths.
+ boost::shared_ptr<PathManipulator> hold(i->second);
+ ((hold.get())->*method)();
+ i = next_i;
}
}
template <typename R, typename A>
diff --git a/src/ui/tool/node.h b/src/ui/tool/node.h
index 025c460e2..a05f0e3b9 100644
--- a/src/ui/tool/node.h
+++ b/src/ui/tool/node.h
@@ -20,12 +20,7 @@
#include <iosfwd>
#include <stdexcept>
#include <cstddef>
-
-#if __cplusplus >= 201103L
#include <functional>
-#else
-#include <tr1/functional>
-#endif
#include <boost/enable_shared_from_this.hpp>
#include <boost/shared_ptr.hpp>