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
This commit is contained in:
Florian Müllner 2015-02-27 02:09:02 +01:00 committed by Adel Gadllah
parent bff6f71488
commit 681e1b2075

View File

@ -513,10 +513,13 @@ const Dash = new Lang.Class({
this._syncLabel(item, appIcon); 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; this._labelShowing = false;
item.hideLabel(); item.hideLabel();
})); }));
item.child.connect('destroy', function() {
Main.overview.disconnect(id);
});
if (appIcon) { if (appIcon) {
appIcon.connect('sync-tooltip', Lang.bind(this, function() { appIcon.connect('sync-tooltip', Lang.bind(this, function() {