diff --git a/porting/nimble/src/nimble_port.c b/porting/nimble/src/nimble_port.c index 9d088e188..a7ad7a516 100644 --- a/porting/nimble/src/nimble_port.c +++ b/porting/nimble/src/nimble_port.c @@ -103,9 +103,6 @@ static struct ble_hs_stop_listener stop_listener; extern void os_msys_init(void); extern void os_msys_buf_free(void); extern void os_mempool_module_init(void); -#if MYNEWT_VAL(MP_RUNTIME_ALLOC) -extern void os_mempool_deinit(void); -#endif #if MYNEWT_VAL(BLE_STATIC_TO_DYNAMIC) static int @@ -366,7 +363,7 @@ esp_err_t esp_nimble_deinit(void) bt_osal_freertos_funcs_deinit(); #if MYNEWT_VAL(MP_RUNTIME_ALLOC) - os_mempool_deinit(); + os_mempool_deinit_all(false); #endif return ret; diff --git a/porting/nimble/src/os_mempool.c b/porting/nimble/src/os_mempool.c index e351be838..2acb29771 100644 --- a/porting/nimble/src/os_mempool.c +++ b/porting/nimble/src/os_mempool.c @@ -901,24 +901,3 @@ os_mempool_module_init(void) #endif } -#if MYNEWT_VAL(MP_RUNTIME_ALLOC) -void -os_mempool_deinit(void) -{ - struct os_mempool *mp = NULL; - - mp = STAILQ_FIRST(&g_os_mempool_list); - - // All mempool blocks should be reclaimed after nimble deinit - while (mp) { - if (mp->mp_flags & OS_MEMPOOL_F_RUNTIME) { - os_mempool_clear(mp); - } - mp = STAILQ_NEXT(mp, mp_list); - } -#if MYNEWT_VAL(BLE_STATIC_TO_DYNAMIC) - STAILQ_INIT(&g_os_mempool_list); - g_os_mempool_list_inited = false; -#endif -} -#endif