mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'bugfix/wifi_prov_deinit_github_v5.0' into 'release/v5.0'
wifi_prov_mgr: Fixed memory leak after bluetooth stack was stopping. (v5.0) See merge request espressif/esp-idf!23437
This commit is contained in:
@ -352,6 +352,15 @@ static void transport_simple_ble_connect(esp_gatts_cb_event_t event, esp_gatt_if
|
|||||||
{
|
{
|
||||||
esp_err_t ret;
|
esp_err_t ret;
|
||||||
ESP_LOGD(TAG, "Inside BLE connect w/ conn_id - %d", param->connect.conn_id);
|
ESP_LOGD(TAG, "Inside BLE connect w/ conn_id - %d", param->connect.conn_id);
|
||||||
|
|
||||||
|
#ifdef CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV
|
||||||
|
/* Ignore BLE events received after protocomm layer is stopped */
|
||||||
|
if (protoble_internal == NULL) {
|
||||||
|
ESP_LOGI(TAG,"Protocomm layer has already stopped");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (protoble_internal->pc_ble->sec &&
|
if (protoble_internal->pc_ble->sec &&
|
||||||
protoble_internal->pc_ble->sec->new_transport_session) {
|
protoble_internal->pc_ble->sec->new_transport_session) {
|
||||||
ret = protoble_internal->pc_ble->sec->new_transport_session(protoble_internal->pc_ble->sec_inst,
|
ret = protoble_internal->pc_ble->sec->new_transport_session(protoble_internal->pc_ble->sec_inst,
|
||||||
@ -599,6 +608,7 @@ esp_err_t protocomm_ble_stop(protocomm_t *pc)
|
|||||||
if (ret) {
|
if (ret) {
|
||||||
ESP_LOGE(TAG, "BLE stop failed");
|
ESP_LOGE(TAG, "BLE stop failed");
|
||||||
}
|
}
|
||||||
|
simple_ble_deinit();
|
||||||
#else
|
#else
|
||||||
#ifdef CONFIG_WIFI_PROV_DISCONNECT_AFTER_PROV
|
#ifdef CONFIG_WIFI_PROV_DISCONNECT_AFTER_PROV
|
||||||
/* Keep BT stack on, but terminate the connection after provisioning */
|
/* Keep BT stack on, but terminate the connection after provisioning */
|
||||||
|
@ -568,6 +568,15 @@ static void transport_simple_ble_connect(struct ble_gap_event *event, void *arg)
|
|||||||
{
|
{
|
||||||
esp_err_t ret;
|
esp_err_t ret;
|
||||||
ESP_LOGD(TAG, "Inside BLE connect w/ conn_id - %d", event->connect.conn_handle);
|
ESP_LOGD(TAG, "Inside BLE connect w/ conn_id - %d", event->connect.conn_handle);
|
||||||
|
|
||||||
|
#ifdef CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV
|
||||||
|
/* Ignore BLE events received after protocomm layer is stopped */
|
||||||
|
if (protoble_internal == NULL) {
|
||||||
|
ESP_LOGI(TAG,"Protocomm layer has already stopped");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (protoble_internal->pc_ble->sec &&
|
if (protoble_internal->pc_ble->sec &&
|
||||||
protoble_internal->pc_ble->sec->new_transport_session) {
|
protoble_internal->pc_ble->sec->new_transport_session) {
|
||||||
ret =
|
ret =
|
||||||
@ -972,6 +981,7 @@ esp_err_t protocomm_ble_stop(protocomm_t *pc)
|
|||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
nimble_port_deinit();
|
nimble_port_deinit();
|
||||||
}
|
}
|
||||||
|
free_gatt_ble_misc_memory(ble_cfg_p);
|
||||||
#else
|
#else
|
||||||
#ifdef CONFIG_WIFI_PROV_DISCONNECT_AFTER_PROV
|
#ifdef CONFIG_WIFI_PROV_DISCONNECT_AFTER_PROV
|
||||||
/* Keep BT stack on, but terminate the connection after provisioning */
|
/* Keep BT stack on, but terminate the connection after provisioning */
|
||||||
|
Reference in New Issue
Block a user