[gnome-shell] status/network: Disconnect signal handler on destroy in NMConnectionItem



commit dfc44973de2a5e9d91528519e462638c63fe9dcb
Author: Sebastian Keller <skeller gnome org>
Date:   Tue Mar 30 16:37:05 2021 +0200

    status/network: Disconnect signal handler on destroy in NMConnectionItem
    
    Otherwise this can trigger _sync() calls after the objects it is trying
    to update have been destroyed.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4013
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1782>

 js/ui/status/network.js | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 50423048c5..5487fde40f 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -128,6 +128,11 @@ var NMConnectionItem = class {
     }
 
     destroy() {
+        if (this._activeConnectionChangedId) {
+            this._activeConnection.disconnect(this._activeConnectionChangedId);
+            this._activeConnectionChangedId = 0;
+        }
+
         this.labelItem.destroy();
         this.radioItem.destroy();
     }


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