[gnome-shell/gnome-3-14] dash: Fix leaking signal connections



commit 681e1b2075aed4e0116b6d7d2f7639015a6ed0c5
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 27 02:09:02 2015 +0100

    dash: Fix leaking signal connections
    
    The overview has a longer life-time than dash items, so we are
    leaking a signal connection each time an item is destroyed.
    Spotted by Michele (<micxgx gmail com>)
    
    https://bugzilla.gnome.org/show_bug.cgi?id=744575

 js/ui/dash.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 99635cd..01727e3 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -513,10 +513,13 @@ const Dash = new Lang.Class({
             this._syncLabel(item, appIcon);
         }));
 
-        Main.overview.connect('hiding', Lang.bind(this, function() {
+        let id = Main.overview.connect('hiding', Lang.bind(this, function() {
             this._labelShowing = false;
             item.hideLabel();
         }));
+        item.child.connect('destroy', function() {
+            Main.overview.disconnect(id);
+        });
 
         if (appIcon) {
             appIcon.connect('sync-tooltip', Lang.bind(this, function() {


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