device: destroy state watchlist after removed event
This commit is contained in:
parent
42d26089e9
commit
2d87556b6b
|
@ -1212,12 +1212,12 @@ static void device_free(void *user)
|
||||||
dbus_pending_reply(&device->connect_pending,
|
dbus_pending_reply(&device->connect_pending,
|
||||||
dbus_error_aborted(device->connect_pending));
|
dbus_error_aborted(device->connect_pending));
|
||||||
|
|
||||||
watchlist_destroy(&device->state_watches);
|
|
||||||
|
|
||||||
if (device->state != DEVICE_STATE_OFF)
|
if (device->state != DEVICE_STATE_OFF)
|
||||||
WATCHLIST_NOTIFY(&device_watches, device_watch_func_t,
|
WATCHLIST_NOTIFY(&device_watches, device_watch_func_t,
|
||||||
device, DEVICE_EVENT_REMOVED);
|
device, DEVICE_EVENT_REMOVED);
|
||||||
|
|
||||||
|
watchlist_destroy(&device->state_watches);
|
||||||
|
|
||||||
dbus = dbus_get_bus();
|
dbus = dbus_get_bus();
|
||||||
l_dbus_unregister_object(dbus, device_get_path(device));
|
l_dbus_unregister_object(dbus, device_get_path(device));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue