fix(nimble): Add fix to handle service reset during server start

This commit is contained in:
Rahul Tank
2026-08-14 13:49:31 +05:30
parent 4c282bd44a
commit 5f235bdf6f
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -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;
+6
View File
@@ -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;