GNOME Bugzilla – Bug 451639
Gtk2::Gdk::Pixbuf::render_pixmap_and_mask leaks X memory
Last modified: 2007-07-05 22:08:47 UTC
Please describe the problem: Using the Gtk2::Gdk::Pixbuf::render_pixmap_and_mask function leaks GObjects and X ressources. see http://mail.gnome.org/archives/gtk-perl-list/2007-April/msg00076.html Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Created attachment 90757 [details] testcase testcase, replace file.jpg by a real image file. Don't let it run too long or it might crash your X server.
Looks like muppet's patch hasn't been committed yet. muppet, can you commit it? If that patch doesn't fix the leaks you're seeing, as you said on the list, then I think it's an issue in the underlying library. Also, how do you measure that this is leaking?
I simply use top (press 'M' to sort by memory), and watch Xorg memory usage grows. It grows pretty fast, for example with a 600x800 jpg picture it grew by 500m in 30s (=300 function calls).
http://gtk2-perl.cvs.sourceforge.net/gtk2-perl/gtk2-perl-xs/Gtk2/xs/GdkPixbuf.xs?r1=1.38&r2=1.39
Created attachment 91273 [details] [review] Mortalize returned scalars It turns out that the previous patch wasn't enough. We still need to mortalize the returned scalars. This patch fixes the issue for me.
Works for me too, thanks
Committed to both branches.