From f13487cae98df92135f091635b137e6224b1a373 Mon Sep 17 00:00:00 2001 From: "freddy.li" Date: Wed, 17 Nov 2021 11:30:54 +0800 Subject: [PATCH] Remove the GIL lock to prevent memory leaks. --- py/runtime.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/py/runtime.c b/py/runtime.c index f86af33..6955e17 100644 --- a/py/runtime.c +++ b/py/runtime.c @@ -157,6 +157,11 @@ void mp_deinit(void) { MICROPY_PORT_DEINIT_FUNC; #endif + //Remove the GIL lock to prevent memory leaks. + #if MICROPY_PY_THREAD_GIL + mp_thread_mutex_del(&MP_STATE_VM(gil_mutex)); + #endif + // mp_obj_dict_free(&dict_main); // mp_map_deinit(&MP_STATE_VM(mp_loaded_modules_map)); } -- Gitee