From cdfe88fdf72647144a10d3230c663977364f3d00 Mon Sep 17 00:00:00 2001 From: Nathan Lee <2431820-nathanal@users.noreply.gitlab.com> Date: Sat, 25 May 2019 20:14:13 +1000 Subject: Check knot's pattern still exists before update Stop crash when pattern changed via swatch palette, and knot is still present. https://gitlab.com/inkscape/inkscape/issues/70 --- src/knotholder.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/knotholder.cpp') diff --git a/src/knotholder.cpp b/src/knotholder.cpp index 9594a233f..d12f61a98 100644 --- a/src/knotholder.cpp +++ b/src/knotholder.cpp @@ -105,8 +105,15 @@ void KnotHolder::updateControlSizes() void KnotHolder::update_knots() { - for (auto e : entity) { - e->update_knot(); + for (auto e = entity.begin(); e != entity.end(); ) { + // check if pattern was removed without deleting the knot + if ((*e)->knot_missing()) { + delete (*e); + e = entity.erase(e); + } else { + (*e)->update_knot(); + ++e; + } } } -- cgit v1.2.3