diff options
author | Matt Watson <mattdangerw@gmail.com> | 2013-11-14 18:21:47 -0800 |
---|---|---|
committer | Matt Watson <mattdangerw@gmail.com> | 2013-11-15 11:22:12 -0800 |
commit | 32f9ad139a40f86e20feb9f06f98782c90d21b11 (patch) | |
tree | caafab6a31b399c5a214a2f51b35180ccc3580eb | |
parent | 1828f10ab902a6349f9b277b0beb065e65b6dfaa (diff) |
Dispose cairo context in vfunc_draw
For our category buttons, otherwise the context and all associated
resources are never freed
[endlessm/eos-sdk#403]
-rw-r--r-- | wikipedia/widgets/category_button.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/wikipedia/widgets/category_button.js b/wikipedia/widgets/category_button.js index 7044829..667a816 100644 --- a/wikipedia/widgets/category_button.js +++ b/wikipedia/widgets/category_button.js @@ -197,7 +197,12 @@ const CategoryButton = new Lang.Class({ Gdk.cairo_set_source_pixbuf(cr, this._pixbuf, 0, 0); cr.paint(); } - this.parent(cr); + let ret = this.parent(cr); + // We need to manually call dispose on cairo contexts. This is somewhat related to the bug listed here + // https://bugzilla.gnome.org/show_bug.cgi?id=685513 for the shell. We should see if they come up with + // a better fix in the future, i.e. fix this through gjs. + cr.$dispose(); + return ret; }, // HANDLERS |