diff options
| author | bulia byak <buliabyak@gmail.com> | 2008-07-19 04:33:41 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2008-07-19 04:33:41 +0000 |
| commit | 6091223b94a11d33546cf99f4112de2866bbab05 (patch) | |
| tree | 6270ac7b7fd4e954b60c06829525b177e5a86c9f /src | |
| parent | a better way to make cursor change immediate; of course this trick is not doc... (diff) | |
| download | inkscape-6091223b94a11d33546cf99f4112de2866bbab05.tar.gz inkscape-6091223b94a11d33546cf99f4112de2866bbab05.zip | |
fix crash when simplifying an lpe path: deleting the list didn't release the references, and it didn't work in _finalize anyway
(bzr r6358)
Diffstat (limited to 'src')
| -rw-r--r-- | src/sp-lpe-item.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index 229ae326e..2eecd8e45 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -129,8 +129,6 @@ sp_lpe_item_finalize(GObject *object) if (((GObjectClass *) (parent_class))->finalize) { (* ((GObjectClass *) (parent_class))->finalize)(object); } - - delete SP_LPE_ITEM(object)->path_effect_list; } /** @@ -154,12 +152,21 @@ sp_lpe_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *r static void sp_lpe_item_release(SPObject *object) { - SPLPEItem *lpeitem; - lpeitem = (SPLPEItem *) object; + SPLPEItem *lpeitem = (SPLPEItem *) object; lpeitem->lpe_modified_connection.disconnect(); lpeitem->lpe_modified_connection.~connection(); + PathEffectList::iterator it = lpeitem->path_effect_list->begin(); + while ( it != lpeitem->path_effect_list->end() ) { + // unlink and delete all references in the list + (*it)->unlink(); + delete *it; + it = lpeitem->path_effect_list->erase(it); + } + // delete the list itself + delete SP_LPE_ITEM(object)->path_effect_list; + if (((SPObjectClass *) parent_class)->release) ((SPObjectClass *) parent_class)->release(object); } |
