After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 596612 - gtk_widget_get_snapshot bindings are missing caller-owns-return
gtk_widget_get_snapshot bindings are missing caller-owns-return
Status: RESOLVED FIXED
Product: pygtk
Classification: Bindings
Component: gtk
Git Master
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2009-09-28 14:52 UTC by Benjamin Berg
Modified: 2009-10-06 18:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch that should fix the issue (354 bytes, application/octet-stream)
2009-09-28 14:52 UTC, Benjamin Berg
Details

Description Benjamin Berg 2009-09-28 14:52:35 UTC
Created attachment 144179 [details]
patch that should fix the issue

See summary.
Comment 1 Benjamin Berg 2009-09-28 15:10:03 UTC
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.)
Comment 2 Benjamin Berg 2009-09-29 09:19:17 UTC
It seems that the second leak that I am seeing is a python-vte bug.
Comment 3 Paul Pogonyshev 2009-10-06 18:55:59 UTC
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.