[polari/wip/fmuellner/invalid-object-access: 3/10] connectionDetails: Disconnect networksManager signal



commit 86c9f52a43407453e738bb57cafe2888372409c2
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Dec 10 16:06:40 2017 +0100

    connectionDetails: Disconnect networksManager signal
    
    While networks don't actually change after startup for the time
    being, that might change in the future, so disconnect signals from
    the NetworksManager singleton when the widget is destroyed.
    
    https://gitlab.gnome.org/GNOME/polari/issues/32

 src/connections.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/connections.js b/src/connections.js
index 2b37951..0596258 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -271,10 +271,14 @@ var ConnectionDetails = GObject.registerClass({
 }, class ConnectionDetails extends Gtk.Grid {
     _init(params) {
         this._networksManager = NetworksManager.getDefault();
-        this._networksManager.connect('changed', () => {
+        let id = this._networksManager.connect('changed', () => {
             this.notify('has-service');
         });
 
+        this.connect('destroy', () => {
+            this._networksManager.disconnect(id);
+        });
+
         this._account = null;
 
         super._init(params);


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