From ffdb85e00361780ecea8b4e1b1bdf6647cbe49c8 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Thu, 9 Oct 2014 14:31:04 -0400 Subject: [PATCH] messageTray: add some missing signal disconnections Disconnect some signal connections that weren't disconnected on actor destroy (not the result of comprehensive review.) https://bugzilla.gnome.org/show_bug.cgi?id=738256 --- js/ui/messageTray.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index fb0b0ef41..cedb410ed 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -1159,6 +1159,7 @@ const SourceActor = new Lang.Class({ this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight)); this.actor.connect('allocate', Lang.bind(this, this._allocate)); this.actor.connect('destroy', Lang.bind(this, function() { + this._source.disconnect(this._iconUpdatedId); this._actorDestroyed = true; })); this._actorDestroyed = false; @@ -1170,7 +1171,7 @@ const SourceActor = new Lang.Class({ this.actor.add_actor(this._iconBin); - this._source.connect('icon-updated', Lang.bind(this, this._updateIcon)); + this._iconUpdatedId = this._source.connect('icon-updated', Lang.bind(this, this._updateIcon)); this._updateIcon(); }, @@ -1228,8 +1229,12 @@ const SourceActorWithLabel = new Lang.Class({ this.actor.add_actor(this._counterBin); - this._source.connect('count-updated', Lang.bind(this, this._updateCount)); + this._countUpdatedId = this._source.connect('count-updated', Lang.bind(this, this._updateCount)); this._updateCount(); + + this.actor.connect('destroy', function() { + this._source.disconnect(this._countUpdatedId); + }); }, _allocate: function(actor, box, flags) {