mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-11-06 04:22:49 +00:00
fix(nimble): Add fix to handle service reset during server start
This commit is contained in:
@@ -3542,6 +3542,11 @@ ble_att_svr_free_start_mem(void)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
/* Entries are allocated from the pool being torn down here; drop them
|
||||
* first or the list heads keep dangling pointers across a restart.
|
||||
*/
|
||||
ble_att_svr_reset();
|
||||
|
||||
if (ble_att_svr_entry_mem) {
|
||||
nimble_platform_mem_free(ble_att_svr_entry_mem);
|
||||
ble_att_svr_entry_mem = NULL;
|
||||
|
||||
@@ -1937,6 +1937,12 @@ ble_gatts_free_mem(void)
|
||||
void
|
||||
ble_gatts_stop(void)
|
||||
{
|
||||
#if MYNEWT_VAL(BLE_STATIC_TO_DYNAMIC)
|
||||
if (ble_gatts_static_vars == NULL) {
|
||||
ble_att_svr_stop();
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
ble_gatts_free_mem();
|
||||
|
||||
ble_hs_max_services = 0;
|
||||
|
||||
Reference in New Issue
Block a user