summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2008-03-12 13:12:26 +0000
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2008-03-12 13:12:26 +0000
commit43ac7906eea6b1856379c8b4c4c8a8323def462b (patch)
tree8651855e1da4a4940b3d17f670d2a4ca22e9dc1e /hcid
parent934d86c2c9000c7109c250eb0171c01375059217 (diff)
Unregister the devices when adapter is down
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-hci.c7
1 files changed, 7 insertions, 0 deletions
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);