GNOME Bugzilla – Bug 646708
network: fix two warnings when removing a network device
Last modified: 2011-04-11 14:45:16 UTC
NMApplet connects to each NMDevice's state-changed signal and stores the signal handler id on the NMDevice itself. However, it was using the same name as NMDevice itself was using to store the handler ID for the underlying GObject's state-changed signal, thus overwriting it, and resulting in *neither* signal handler getting removed if the device went away. (This probably isn't a problem, since the device is going away, but it causes a warning.) Also, at least for WWAN devices, the device state changes to UNMANAGED immediately before disappearing, but getStatusLabel() wasn't handling that case and printed a warning instead. Fix that.
Created attachment 185104 [details] [review] network: fix two warnings when removing a network device
Review of attachment 185104 [details] [review]: A better fix would be to wrap the NMDevice into a small object, so we're sure we don't conflict (like PopupMenuManager does, for example), but it would be more invasive, so ok this way. The second part is correct. (This is indeed a problem, as the GObject roots the JS function that handles the signal, which references the JS object, which references the GObject, creating an uncollectable cycle)
Attachment 185104 [details] pushed as 5b1a76a - network: fix two warnings when removing a network device