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 722812 - osdWindow memory leak, cairo context never freed
osdWindow memory leak, cairo context never freed
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: message-tray
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-23 03:17 UTC by Matt Watson
Modified: 2014-01-29 00:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch for disposing cairo context (860 bytes, patch)
2014-01-23 03:29 UTC, Matt Watson
accepted-commit_now Details | Review
Patch v2 (1.29 KB, patch)
2014-01-23 19:09 UTC, Matt Watson
committed Details | Review

Description Matt Watson 2014-01-23 03:17:17 UTC
Cairo contexts need to be manually freed with the $dispose method when used in javascript. osdWindow uses cairo for drawing it's background, but doesn't free the context.

It's a fairly slow leak, but spammed the shell with a 100 or so notifications and eventually doubled shell memory usage.
Comment 1 Matt Watson 2014-01-23 03:29:04 UTC
Its a one line fix I think, attached a patch
Comment 2 Matt Watson 2014-01-23 03:29:52 UTC
Created attachment 267016 [details] [review]
patch for disposing cairo context
Comment 3 Rui Matos 2014-01-23 10:46:14 UTC
Review of attachment 267016 [details] [review]:

No sure if there ever was a fix for this to stop being needed but yeah, right now we are doing it everywhere else.

Actually, everywhere else except in _drawArrow() in screenShield.js, care to include that as well in the patch ?
Comment 4 Matt Watson 2014-01-23 19:09:20 UTC
Created attachment 267071 [details] [review]
Patch v2
Comment 5 Matt Watson 2014-01-23 19:09:46 UTC
Good catch. Included in the patch
Comment 6 drago01 2014-01-24 12:46:38 UTC
Review of attachment 267071 [details] [review]:

LG.
Comment 7 Cosimo Cecchi 2014-01-29 00:48:17 UTC
Pushed on Matt's behalf, since he doesn't have a GNOME git account.