From 06a7e8da1c4d15de693f54c1d929a064495dd7dc Mon Sep 17 00:00:00 2001 From: buliabyak Date: Sun, 22 Mar 2009 20:14:05 +0000 Subject: [PATCH] fix crash when tweak-deleting objects in groups: you cannot get SP_OBJECT_NEXT from a deleted object --- src/tweak-context.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 7d797915e..68e62b975 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -420,13 +420,21 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P } if (SP_IS_GROUP(item) && !SP_IS_BOX3D(item)) { + GSList *children = NULL; for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) { if (SP_IS_ITEM(child)) { - if (sp_tweak_dilate_recursive (selection, SP_ITEM(child), p, vector, mode, radius, force, fidelity, reverse)) - did = true; + children = g_slist_prepend(children, child); } } + for (GSList *i = children; i; i = i->next) { + SPItem *child = SP_ITEM(i->data); + if (sp_tweak_dilate_recursive (selection, SP_ITEM(child), p, vector, mode, radius, force, fidelity, reverse)) + did = true; + } + + g_slist_free(children); + } else { if (mode == TWEAK_MODE_MOVE) { @@ -524,6 +532,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P } Inkscape::GC::release(copy); } + did = true; } } } -- 2.30.2