summaryrefslogtreecommitdiffstats
path: root/btif/src
diff options
context:
space:
mode:
Diffstat (limited to 'btif/src')
-rwxr-xr-xbtif/src/btif_core.c2
-rwxr-xr-x[-rw-r--r--]btif/src/btif_profile_queue.c24
2 files changed, 26 insertions, 0 deletions
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;
+}
+