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:
parent
0e636ea67e
commit
d583c48992
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user