[polari/wip/fmuellner/invalid-object-access: 4/10] chatView: Reuse existing destroy handler
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/invalid-object-access: 4/10] chatView: Reuse existing destroy handler
- Date: Sun, 10 Dec 2017 15:18:28 +0000 (UTC)
commit a0f7e9c5c9bcb2801dc3ed1b5b5f7f5bc388254f
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Dec 6 10:38:07 2017 +0100
chatView: Reuse existing destroy handler
Splitting clean up code between various ::destroy handlers is just
confusing ...
https://gitlab.gnome.org/GNOME/polari/issues/32
src/chatView.js | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 35b19a0..fd4e6ba 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -398,11 +398,6 @@ var ChatView = GObject.registerClass({
this._nickStatusChangedId = this._userTracker.watchRoomStatus(this._room,
null,
this._onNickStatusChanged.bind(this));
-
- this.connect('destroy', () => {
- this._userTracker.unwatchRoomStatus(this._room, this._nickStatusChangedId);
- this._userTracker = null;
- });
}
_createTags() {
@@ -519,6 +514,12 @@ var ChatView = GObject.registerClass({
Mainloop.source_remove(this._backlogTimeoutId);
this._backlogTimeoutId = 0;
+ if (this._nickStatusChangedId)
+ this._userTracker.unwatchRoomStatus(this._room,
+ this._nickStatusChangedId);
+ this._nickStatusChangedId = 0;
+ this._userTracker = null;
+
this._logWalker.run_dispose();
this._logWalker = null;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]