diff options
author | Alok Barsode <alok.barsode@azingo.com> | 2008-08-28 14:47:04 +0530 |
---|---|---|
committer | Alok Barsode <alok.barsode@azingo.com> | 2008-08-29 13:53:11 +0530 |
commit | 67696e910549b77004bf7f68003a46728c891f05 (patch) | |
tree | ec5c1530e3745d4fe6dceb1340cd66f69fe388d4 /src/adapter.c | |
parent | 344789216712689037f57cb7bc2dc7a333a95333 (diff) |
Freeing found_devices list on end of standard/periodic inquiry.
Diffstat (limited to 'src/adapter.c')
-rw-r--r-- | src/adapter.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c index bc49090c..43f0521f 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -2739,6 +2739,21 @@ void adapter_set_state(struct adapter *adapter, int state) if (!adapter) return; + /* Both Standard and periodic Inquiry are in progress */ + if ((state & STD_INQUIRY) && (state & PERIODIC_INQUIRY)) + goto set; + + if (!adapter->found_devices) + goto set; + + /* Free list if standard/periodic inquiry is done */ + if ((adapter->state & (STD_INQUIRY | PERIODIC_INQUIRY)) && + (state & (~STD_INQUIRY | ~PERIODIC_INQUIRY))) { + g_slist_foreach(adapter->found_devices, (GFunc) g_free, NULL); + g_slist_free(adapter->found_devices); + adapter->found_devices = NULL; + } +set: adapter->state = state; } |