network: deal with recycling of closed active connections

If you restart NetworkManager, then the list of active connections
is emptied, then comes back with the same GObjects in it. If the
_primaryDevice field isn't cleared on the object, then we won't
know we need to set it back on the device, resulting in the active
device not showing up in the menu.

https://bugzilla.gnome.org/show_bug.cgi?id=646558
This commit is contained in:
Owen W. Taylor 2011-04-02 15:30:45 -04:00 committed by Dan Winship
parent 625a4c0766
commit 529b6ca935

View File

@ -1758,8 +1758,10 @@ NMApplet.prototype = {
for (let i = 0; i < closedConnections.length; i++) {
let active = closedConnections[i];
if (active._primaryDevice)
if (active._primaryDevice) {
active._primaryDevice.setActiveConnection(null);
active._primaryDevice = null;
}
if (active._notifyStateId) {
active.disconnect(active._notifyStateId);
active._notifyStateId = 0;