[gnome-shell] Dispose cairo contexts in osdWindow and screenShield



commit 7c8c8111344bc0706a90525b36e3e88d479db833
Author: Matt Watson <mattdangerw gmail com>
Date:   Wed Jan 22 19:10:21 2014 -0800

    Dispose cairo contexts in osdWindow and screenShield
    
    Need to manually dispose of cairo contexts used in gjs with $dispose(),
    or the context object will leak. These classes used cairo for drawing but
    were missing the dispose call.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=722812

 js/ui/osdWindow.js    |    1 +
 js/ui/screenShield.js |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/osdWindow.js b/js/ui/osdWindow.js
index 773960c..199899f 100644
--- a/js/ui/osdWindow.js
+++ b/js/ui/osdWindow.js
@@ -66,6 +66,7 @@ const LevelBar = new Lang.Class({
         cr.arc(radius, h - radius, radius, 0.5 * Math.PI, Math.PI);
         cr.arc(radius, radius, radius, Math.PI, 1.5 * Math.PI);
         cr.fill();
+        cr.$dispose();
     }
 });
 
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 93dc812..c0e58b3 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -413,6 +413,7 @@ const Arrow = new Lang.Class({
         cr.lineTo(w/2, thickness);
         cr.lineTo(w - thickness / 2, h - thickness / 2);
         cr.stroke();
+        cr.$dispose();
     },
 
     vfunc_style_changed: function() {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]