From: buliabyak Date: Mon, 22 Sep 2008 02:05:03 +0000 (+0000) Subject: hide item instead of unreffing, and unref arena to prevent memory leak X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b0a706debff59200299511d55822722c5cb3e15f;p=inkscape.git hide item instead of unreffing, and unref arena to prevent memory leak --- diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp index 25e4920b9..ee5f72161 100644 --- a/src/helper/pixbuf-ops.cpp +++ b/src/helper/pixbuf-ops.cpp @@ -84,6 +84,7 @@ sp_export_jpg_file(SPDocument *doc, gchar const *filename, g_snprintf(c, 32, "%f", quality); gboolean saved = gdk_pixbuf_save (pixbuf, filename, "jpeg", NULL, "quality", c, NULL); g_free(c); + gdk_pixbuf_unref (pixbuf); if (saved) return true; else return false; } @@ -106,7 +107,6 @@ sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/, Geom::Rect screen=Geom::Rect(Geom::Point(x0,y0), Geom::Point(x1, y1)); - double zoom_scale = 1.0; double padding = 1.0; Geom::Point origin(screen.min()[Geom::X], @@ -169,7 +169,8 @@ sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/, (GdkPixbufDestroyNotify)g_free, NULL); - nr_arena_item_unref(root); + sp_item_invoke_hide (SP_ITEM(sp_document_root(doc)), dkey); + nr_object_unref((NRObject *) arena); // gdk_pixbuf_save (pixbuf, "C:\\temp\\internal.jpg", "jpeg", NULL, "quality","100", NULL);