Merge branch 'bugfix/btdm_mem_leak_of_bt' into 'master'

component/bt: Fix mem leak of bt

See merge request idf/esp-idf!1924
This commit is contained in:
Jiang Jiang Jian 2018-02-24 10:25:13 +08:00
commit 165e3edd49
5 changed files with 19 additions and 5 deletions

View File

@ -1847,6 +1847,8 @@ void bta_av_dereg_comp(tBTA_AV_DATA *p_data)
/* make sure that the timer is not active */
bta_sys_stop_timer(&p_scb->timer);
list_free(p_scb->a2d_list);
p_scb->a2d_list = NULL;
utl_freebuf((void **)&p_cb->p_scb[p_scb->hdi]);
}

View File

@ -273,7 +273,10 @@ error_exit:;
vQueueDelete(btc_aa_snk_ctrl_queue);
btc_aa_snk_ctrl_queue = NULL;
}
if (btc_aa_snk_queue_set) {
vQueueDelete(btc_aa_snk_queue_set);
btc_aa_snk_queue_set = NULL;
}
return false;
}
@ -292,6 +295,9 @@ void btc_a2dp_sink_shutdown(void)
vQueueDelete(btc_aa_snk_ctrl_queue);
btc_aa_snk_ctrl_queue = NULL;
vQueueDelete(btc_aa_snk_queue_set);
btc_aa_snk_queue_set = NULL;
}
/*****************************************************************************

View File

@ -348,7 +348,10 @@ error_exit:;
vQueueDelete(btc_aa_src_ctrl_queue);
btc_aa_src_ctrl_queue = NULL;
}
if (btc_aa_src_queue_set) {
vQueueDelete(btc_aa_src_queue_set);
btc_aa_src_queue_set = NULL;
}
return false;
}
@ -367,6 +370,9 @@ void btc_a2dp_source_shutdown(void)
vQueueDelete(btc_aa_src_ctrl_queue);
btc_aa_src_ctrl_queue = NULL;
vQueueDelete(btc_aa_src_queue_set);
btc_aa_src_queue_set = NULL;
}
/*****************************************************************************

View File

@ -27,7 +27,7 @@ static xTaskHandle bt_app_task_handle = NULL;
bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback)
{
ESP_LOGD(BT_APP_CORE_TAG, "%s event 0x%x, param len %d", __func__, event, param_len);
bt_app_msg_t msg;
memset(&msg, 0, sizeof(bt_app_msg_t));
@ -96,7 +96,7 @@ static void bt_app_task_handler(void *arg)
void bt_app_task_start_up(void)
{
bt_app_task_queue = xQueueCreate(10, sizeof(bt_app_msg_t));
xTaskCreate(bt_app_task_handler, "BtAppT", 2048, NULL, configMAX_PRIORITIES - 3, bt_app_task_handle);
xTaskCreate(bt_app_task_handler, "BtAppT", 2048, NULL, configMAX_PRIORITIES - 3, &bt_app_task_handle);
return;
}

View File

@ -96,7 +96,7 @@ static void bt_app_task_handler(void *arg)
void bt_app_task_start_up(void)
{
bt_app_task_queue = xQueueCreate(10, sizeof(bt_app_msg_t));
xTaskCreate(bt_app_task_handler, "BtAppT", 2048, NULL, configMAX_PRIORITIES - 3, bt_app_task_handle);
xTaskCreate(bt_app_task_handler, "BtAppT", 2048, NULL, configMAX_PRIORITIES - 3, &bt_app_task_handle);
return;
}