[polari] chatView: Close channels on exit



commit 5041939dc0f2a1fb84ab8b582fcb088bf772fb8b
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jul 25 16:13:32 2013 +0200

    chatView: Close channels on exit

 src/chatView.js |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index cb1be7a..e3a143a 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -173,6 +173,17 @@ const ChatView = new Lang.Class({
         for (let i = 0; i < this._roomSignals.length; i++)
             this._room.disconnect(this._roomSignals[i]);
         this._roomSignals = [];
+
+        if (this._room.channel) {
+            let app = Gio.Application.get_default();
+            app.hold();
+            this._room.channel.connect('invalidated',
+                function() {
+                    app.release();
+                });
+            this._room.channel.leave_async(Tp.ChannelGroupChangeReason.NONE,
+                                           '', null);
+        }
     },
 
     _updateIndent: function() {


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