From ccfc9f3ab06e33c5f25c0765f646143a33908f1b Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Mon, 20 Jan 2014 23:21:14 +0100 Subject: [PATCH] TelepathyClient: disconnect signals from destroyed ChatSources Otherwise they keep firing if the source is destroyed by the user and they trigger Clutter warnings from touching invalid actors. https://bugzilla.gnome.org/show_bug.cgi?id=722660 --- js/ui/components/telepathyClient.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index e69c2a18e..144d369b2 100644 --- a/js/ui/components/telepathyClient.js +++ b/js/ui/components/telepathyClient.js @@ -621,7 +621,11 @@ const ChatSource = new Lang.Class({ this.notify(); }, - _channelClosed: function() { + destroy: function(reason) { + if (this._destroyed) + return; + + this._destroyed = true; this._channel.disconnect(this._closedId); this._channel.disconnect(this._receivedId); this._channel.disconnect(this._pendingId); @@ -631,7 +635,14 @@ const ChatSource = new Lang.Class({ this._contact.disconnect(this._notifyAvatarId); this._contact.disconnect(this._presenceChangedId); - this.destroy(); + if (this._timestampTimeoutId) + Mainloop.source_remove(this._timestampTimeoutId); + + this.parent(reason); + }, + + _channelClosed: function() { + this.destroy(MessageTray.NotificationDestroyedReason.SOURCE_CLOSED); }, /* All messages are new messages for Telepathy sources */