Code

hide item instead of unreffing, and unref arena to prevent memory leak
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 22 Sep 2008 02:05:03 +0000 (02:05 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 22 Sep 2008 02:05:03 +0000 (02:05 +0000)
src/helper/pixbuf-ops.cpp

index 25e4920b9fa9c3a1eef8f6c1992d0674895b2339..ee5f72161db11313d812ae17f1b2fb7659b53890 100644 (file)
@@ -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);