diff --git a/src/ui/knot/knot-holder.cpp b/src/ui/knot/knot-holder.cpp index 9d5aa607ef0afc6eff351d9f35718098848db5e2..6eb9749a1e2e70c41bef629e4738c6495545cd86 100644 --- a/src/ui/knot/knot-holder.cpp +++ b/src/ui/knot/knot-holder.cpp @@ -76,10 +76,15 @@ KnotHolder::~KnotHolder() { void KnotHolder::clear() { + if (clearing) { // allow clear again inside entities also + return; + } + clearing = true; for (auto & i : entity) { delete i; } entity.clear(); // is this necessary? + clearing = false; } void diff --git a/src/ui/knot/knot-holder.h b/src/ui/knot/knot-holder.h index d28da672c50c29a9d3c3f117c23e46fc25a54bdf..82f1dbec18d9e6464654ee0697b2c02ecf470d64 100644 --- a/src/ui/knot/knot-holder.h +++ b/src/ui/knot/knot-holder.h @@ -102,7 +102,7 @@ protected: bool local_change; ///< if true, no need to recreate knotholder if repr was changed. bool dragging; - + bool clearing = false; Geom::Affine _edit_transform; Inkscape::auto_connection _watch_fill; Inkscape::auto_connection _watch_stroke;