diff --git a/py/runtime.c b/py/runtime.c index f86af33bb18ac70fb01737c20bdaa1a10cc097ca..6955e172407b45c7bb5ae9cca16c73479a18c7ac 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)); }