[gnome-shell] NetworkMenu: don't queue menu updates for destroyed devices



commit d583c48992e1360c789c51da752cc84622b9736c
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Wed Oct 3 23:38:35 2012 +0200

    NetworkMenu: don't queue menu updates for destroyed devices
    
    It will cause an exception as the work ID is now invalid, and may block
    new devices from appearing for example when NM is restarted.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684279

 js/ui/status/network.js |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index 71e3a73..4bc2335 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -357,6 +357,12 @@ const NMDevice = new Lang.Class({
             this._firmwareChangedId = 0;
         }
 
+        if (this._deferredWorkId) {
+            // Just clear out, the actual removal is handled when the
+            // actor is destroyed
+            this._deferredWorkId = 0;
+        }
+
         this._clearSection();
         if (this.statusItem)
             this.statusItem.destroy();
@@ -490,8 +496,10 @@ const NMDevice = new Lang.Class({
     },
 
     _queueCreateSection: function() {
-        this._clearSection();
-        Main.queueDeferredWork(this._deferredWorkId);
+        if (this._deferredWorkId) {
+            this._clearSection();
+            Main.queueDeferredWork(this._deferredWorkId);
+        }
     },
 
     _clearSection: function() {



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