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
This commit is contained in:
Giovanni Campagna 2014-01-20 23:21:14 +01:00
parent d163b92e0b
commit ccfc9f3ab0

View File

@ -621,7 +621,11 @@ const ChatSource = new Lang.Class({
this.notify(); this.notify();
}, },
_channelClosed: function() { destroy: function(reason) {
if (this._destroyed)
return;
this._destroyed = true;
this._channel.disconnect(this._closedId); this._channel.disconnect(this._closedId);
this._channel.disconnect(this._receivedId); this._channel.disconnect(this._receivedId);
this._channel.disconnect(this._pendingId); this._channel.disconnect(this._pendingId);
@ -631,7 +635,14 @@ const ChatSource = new Lang.Class({
this._contact.disconnect(this._notifyAvatarId); this._contact.disconnect(this._notifyAvatarId);
this._contact.disconnect(this._presenceChangedId); 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 */ /* All messages are new messages for Telepathy sources */