diff options
author | Alok Barsode <alok.barsode@azingo.com> | 2008-09-01 14:25:49 +0530 |
---|---|---|
committer | Alok Barsode <alok@greatbear.(none)> | 2008-09-03 12:05:22 +0530 |
commit | 44bebaf5962f0b0a60b66ec8ab65f1d211b60b9d (patch) | |
tree | 0ead92933405e91c16cd1f35f0701b4de4286791 | |
parent | d8c17dd3fd51a7e2dcc57ece40b2e2d0d4ac50e2 (diff) |
Freeing oor_devices list after device discovery.
-rw-r--r-- | src/adapter.c | 6 | ||||
-rw-r--r-- | src/dbus-hci.c | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/adapter.c b/src/adapter.c index 5cd925ea..bb2e131f 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2715,6 +2715,12 @@ void adapter_set_state(struct adapter *adapter, int state) adapter->found_devices = NULL; } + if (!discov_active && adapter->oor_devices) { + g_slist_foreach(adapter->oor_devices, (GFunc) g_free, NULL); + g_slist_free(adapter->oor_devices); + adapter->oor_devices = NULL; + } + dbus_connection_emit_property_changed(connection, path, ADAPTER_INTERFACE, "Discovering", DBUS_TYPE_BOOLEAN, &discov_active); diff --git a/src/dbus-hci.c b/src/dbus-hci.c index e67cb64c..69bafa4f 100644 --- a/src/dbus-hci.c +++ b/src/dbus-hci.c @@ -883,11 +883,6 @@ void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status) state = adapter_get_state(adapter); state &= ~PERIODIC_INQUIRY; adapter_set_state(adapter, state); - - /* free out of range devices list */ - g_slist_foreach(adapter->oor_devices, (GFunc) free, NULL); - g_slist_free(adapter->oor_devices); - adapter->oor_devices = NULL; } static char *extract_eir_name(uint8_t *data, uint8_t *type) |