[polari] Stop using destroy vfuncs



commit 9a4747b6964bbf6b0a09b9be87379400fbb0fb90
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Sep 22 19:52:52 2016 +0200

    Stop using destroy vfuncs
    
    They don't work, we need to use the corresponding ::destroy signal
    instead ...

 src/chatView.js  |    5 ++---
 src/roomStack.js |    6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 33e9f42..8f7b997 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -256,6 +256,7 @@ const ChatView = new Lang.Class({
                      Lang.bind(this, this._onStyleUpdated));
         this._onStyleUpdated();
 
+        this.connect('destroy', Lang.bind(this, this._onDestroy));
         this.connect('screen-changed',
                      Lang.bind(this, this._updateIndent));
         this.connect('scroll-event', Lang.bind(this, this._onScroll));
@@ -452,9 +453,7 @@ const ChatView = new Lang.Class({
         this._foreachNickTag(t => { this._updateTagStatus(t); });
     },
 
-    vfunc_destroy: function() {
-        this.parent();
-
+    _onDestroy: function() {
         for (let i = 0; i < this._channelSignals.length; i++)
             this._channel.disconnect(this._channelSignals[i]);
         this._channelSignals = [];
diff --git a/src/roomStack.js b/src/roomStack.js
index 13cc6d2..2870796 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -100,6 +100,8 @@ const SavePasswordConfirmationBar = new Lang.Class({
 
         this.parent({ valign: Gtk.Align.START });
 
+        this.connect('destroy', Lang.bind(this, this._onDestroy));
+
         this._createWidget();
 
         this._identifySentId = this._room.connect('identify-sent', () => {
@@ -145,12 +147,10 @@ const SavePasswordConfirmationBar = new Lang.Class({
         this._infoBar.show_all();
     },
 
-    vfunc_destroy: function() {
+    _onDestroy: function() {
         if (this._identifySentId)
             this._room.disconnect(this._identifySentId);
         this._identifySentId = 0;
-
-        this.parent();
     }
 });
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]