From: buliabyak Date: Tue, 16 Sep 2008 16:37:23 +0000 (+0000) Subject: fix leak of the arena and arenaitem X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ff86396d7bac9863faecc84122d01bd4c5a18606;p=inkscape.git fix leak of the arena and arenaitem --- diff --git a/src/dialogs/iconpreview.cpp b/src/dialogs/iconpreview.cpp index 3994ba454..c3d15d830 100644 --- a/src/dialogs/iconpreview.cpp +++ b/src/dialogs/iconpreview.cpp @@ -268,7 +268,6 @@ void IconPreviewPanel::renderPreview( SPObject* obj ) /* Create ArenaItem and set transform */ unsigned int visionkey = sp_item_display_key_new(1); - /* fixme: Memory manage root if needed (Lauris) */ root = sp_item_invoke_show ( SP_ITEM( SP_DOCUMENT_ROOT(doc) ), arena, visionkey, SP_ITEM_SHOW_DISPLAY ); @@ -285,6 +284,9 @@ void IconPreviewPanel::renderPreview( SPObject* obj ) images[i]->queue_draw(); } updateMagnify(); + + sp_item_invoke_hide(SP_ITEM(sp_document_root(doc)), visionkey); + nr_object_unref((NRObject *) arena); } void IconPreviewPanel::updateMagnify() diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp index fe23516ba..fe621e4f1 100644 --- a/src/dialogs/stroke-style.cpp +++ b/src/dialogs/stroke-style.cpp @@ -688,6 +688,9 @@ sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, SPDocument *source, SPD m->append(*i); } + + sp_item_invoke_hide(SP_ITEM(sp_document_root(sandbox)), visionkey); + nr_object_unref((NRObject *) arena); } /**