GNOME Bugzilla – Bug 596612
gtk_widget_get_snapshot bindings are missing caller-owns-return
Last modified: 2009-10-06 18:55:59 UTC
Created attachment 144179 [details] patch that should fix the issue See summary.
Hm, I am wondering whether the Pixbuf.get_from_drawable bindings are correct. The function just returns the same pixbuf as the one passed in. I found this issue in sugar, and both the X and client memory increased, which points to some other pixbuf function leaking too. The code looks like this: pixmap = self.canvas.get_snapshot((-1, -1, 0, 0)) width, height = pixmap.get_size() pixbuf = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, 0, 8, width, height) pixbuf = pixbuf.get_from_drawable(pixmap, pixmap.get_colormap(), 0, 0, 0, 0, width, height) pixbuf = pixbuf.scale_simple(style.zoom(300), style.zoom(225), gtk.gdk.INTERP_BILINEAR) I guess I could check by trying gtk.gdk.pixbuf_get_from_drawable. (But compiling pygtk is not something I am easily able to do right now.)
It seems that the second leak that I am seeing is a python-vte bug.
Committed into the repository, thanks. Unfortunately, there are certainly tons of leaks like this all over PyGTK and PyGObject. I plugged many in GIO and Pango some months ago.