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
This commit is contained in:
@ -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() {
|
||||
|
Reference in New Issue
Block a user