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 729670 - cairo surface leaked for each cursor created from pixmap
cairo surface leaked for each cursor created from pixmap
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.10.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-05-06 18:50 UTC by David Mansfield
Modified: 2014-05-07 23:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
free the cairo_surface_t so it isn't leaked (814 bytes, patch)
2014-05-06 18:50 UTC, David Mansfield
committed Details | Review

Description David Mansfield 2014-05-06 18:50:55 UTC
Created attachment 276018 [details] [review]
free the cairo_surface_t so it isn't leaked

In gdk/gdkcursor.c, in the function gdk_cursor_new_from_pixbuf, at or around line 350, a cairo_surface_t is created and passed to the underlying implementation to create a cursor object.  This surface is never freed in this context.

Examining some the various backend implementations, none of them apparently free the surface passed in to them either.

The leak becomes very visible in an app creating/changing the cursor a lot. I found it in spice's remote-viewer, which for displaying a remote desktop, changes cursors a lot (and must use a pixmap to create them with a lot).

The attached patch against 3.10.8 (F20 version) seems to fix the leak and seems to be stable.
Comment 1 Marc-Andre Lureau 2014-05-06 19:34:52 UTC
Review of attachment 276018 [details] [review]:

looks good to me