From d583c48992e1360c789c51da752cc84622b9736c Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 3 Oct 2012 23:38:35 +0200 Subject: [PATCH] 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 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 71e3a735b..4bc2335a0 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() {