From aba262b18b1dc1a2bd970b6c99faae0a1e5dd1a8 Mon Sep 17 00:00:00 2001 From: Tian Hao Date: Thu, 15 Dec 2016 01:36:27 +0800 Subject: [PATCH] component/bt : fix bluetooth disable memory leak --- components/bt/bluedroid/bta/dm/bta_dm_api.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/bt/bluedroid/bta/dm/bta_dm_api.c b/components/bt/bluedroid/bta/dm/bta_dm_api.c index 8e20dde169..54cd5695d9 100644 --- a/components/bt/bluedroid/bta/dm/bta_dm_api.c +++ b/components/bt/bluedroid/bta/dm/bta_dm_api.c @@ -2168,12 +2168,20 @@ void BTA_VendorCleanup (void) BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb); #if (BLE_INCLUDED == TRUE && BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE) - btm_ble_adv_filter_cleanup(); // when BLE_VND_INCLUDED is false, this function will be ignore, so move it out of "if" + btm_ble_adv_filter_cleanup(); // when BLE_VND_INCLUDED is false, this function will be ignore, so move it out of "if" + +#if BLE_PRIVACY_SPT == TRUE + btm_ble_resolving_list_cleanup (); //by TH, because cmn_ble_vsc_cb.max_filter has something mistake as btm_ble_adv_filter_cleanup +#endif + +#if 0 //by TH, comment out temporarily if (cmn_ble_vsc_cb.max_filter > 0) { + btm_ble_adv_filter_cleanup(); #if BLE_PRIVACY_SPT == TRUE btm_ble_resolving_list_cleanup (); #endif } +#endif if (cmn_ble_vsc_cb.tot_scan_results_strg > 0) { btm_ble_batchscan_cleanup();