GNOME Bugzilla – Bug 674410
Ref counting error on Device proxy (Network Manager Context)
Last modified: 2012-08-19 15:09:12 UTC
Created attachment 212369 [details] [review] Remove refcounting increment on device proxy when using it. In function nm_device_new, device_proxy refcount was incremented. device_proxy is created in function device_proxy_new_cb() by g_dbus_proxy_new_for_bus_finish call. After this call, refcount = 1. When in device_proxy_new_cb(), nm_device_new() is called, device_proxy refcount=2. So when nm_device_free() is called, device_proxy refcount=1 and such is not deleted. The bug is not critical and doesn't make gupnp crash because device_proxy is not set to NULL after calling g_object_unref in nm_device_free. The side effect is that as the context is not destroyed, the signal handler on this proxy still exist. The signal has been set in use_new_device() function. g_signal_connect (nm_device->proxy, "g-signal", G_CALLBACK (on_device_signal), nm_device); If nm_device->proxy was set to NULL in nm_device_free(), a crash will/could occurs. The side effect is that the callback is called for a device proxy that should be destroyed.
Review of attachment 212369 [details] [review]: Looks correct to me. nm_device takes ownership of the proxy
*** Bug 680950 has been marked as a duplicate of this bug. ***