From 9af2f222d8c7e9775422355f3918e3cf6fe8d8ab Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 30 May 2017 16:46:49 +0200 Subject: Fix bug pointed by parclytaxel in IRC (bzr r15703.1.15) --- src/sp-lpe-item.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index be886bdd2..1333642e9 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -555,19 +555,18 @@ void SPLPEItem::removeAllPathEffects(bool keep_paths) return; } } - for (PathEffectList::const_iterator it = path_effect_list->begin(); it != path_effect_list->end(); ++it) - { + while ( it != this->path_effect_list->end() ) { LivePathEffectObject *lpeobj = (*it)->lpeobject; if (lpeobj) { Inkscape::LivePathEffect::Effect * lpe = lpeobj->get_lpe(); lpe->keep_paths = keep_paths; lpe->doOnRemove(this); } + // unlink and delete all references in the list (*it)->unlink(); delete *it; it = this->path_effect_list->erase(it); } - this->getRepr()->setAttribute("inkscape:path-effect", NULL); if (!keep_paths) { -- cgit v1.2.3 From 61737e7c412d328473b63fb00c2f0a14a8dc0f38 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Tue, 30 May 2017 17:22:35 +0200 Subject: Fix broken fix for bug pointed by parclytaxel in IRC (bzr r15703.1.16) --- src/sp-lpe-item.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 1333642e9..84d318db2 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -555,6 +555,9 @@ void SPLPEItem::removeAllPathEffects(bool keep_paths) return; } } + + PathEffectList::iterator it = this->path_effect_list->begin(); + while ( it != this->path_effect_list->end() ) { LivePathEffectObject *lpeobj = (*it)->lpeobject; if (lpeobj) { -- cgit v1.2.3