diff options
-rwxr-xr-x[-rw-r--r--] | btif/include/btif_profile_queue.h | 2 | ||||
-rwxr-xr-x | btif/src/btif_core.c | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | btif/src/btif_profile_queue.c | 24 |
3 files changed, 28 insertions, 0 deletions
diff --git a/btif/include/btif_profile_queue.h b/btif/include/btif_profile_queue.h index c9ed0e7..8f5f013 100644..100755 --- a/btif/include/btif_profile_queue.h +++ b/btif/include/btif_profile_queue.h @@ -62,4 +62,6 @@ bt_status_t btif_queue_connect(uint16_t uuid, const bt_bdaddr_t *bda, void btif_queue_advance(); +void btif_queue_release(); + #endif diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c index c8b0c8f..777c4ca 100755 --- a/btif/src/btif_core.c +++ b/btif/src/btif_core.c @@ -76,6 +76,7 @@ #include "btif_util.h" #include "btif_sock.h" #include "btif_pan.h" +#include "btif_profile_queue.h" /************************************************************************************ ** Constants & Macros @@ -668,6 +669,7 @@ bt_status_t btif_shutdown_bluetooth(void) btif_shutdown_pending = 0; GKI_destroy_task(BTIF_TASK); + btif_queue_release(); bte_main_shutdown(); BTIF_TRACE_DEBUG1("%s done", __FUNCTION__); diff --git a/btif/src/btif_profile_queue.c b/btif/src/btif_profile_queue.c index f0b6db2..4081c6a 100644..100755 --- a/btif/src/btif_profile_queue.c +++ b/btif/src/btif_profile_queue.c @@ -190,3 +190,27 @@ void btif_queue_advance() NULL, 0, NULL); } + +/******************************************************************************* +** +** Function btif_queue_release +** +** Description Free up all the queue nodes and set the queue head to NULL +** +** Returns void +** +*******************************************************************************/ +void btif_queue_release() +{ + connect_node_t *current = connect_queue; + + while (current != NULL) + { + connect_node_t *next = current->p_next; + GKI_freebuf(current); + current = next; + } + + connect_queue = NULL; +} + |