From 43ac7906eea6b1856379c8b4c4c8a8323def462b Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 12 Mar 2008 13:12:26 +0000 Subject: Unregister the devices when adapter is down --- hcid/dbus-hci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index a9643450..62209956 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -771,6 +771,13 @@ int hcid_dbus_stop_device(uint16_t id) adapter->active_conn = NULL; } + if (adapter->devices) { + g_slist_foreach(adapter->devices, (GFunc) device_remove, NULL); + g_slist_foreach(adapter->devices, (GFunc) free, NULL); + g_slist_free(adapter->devices); + adapter->devices = NULL; + } + send_adapter_signal(connection, adapter->dev_id, "ModeChanged", DBUS_TYPE_STRING, &mode, DBUS_TYPE_INVALID); -- cgit