diff --git a/unity/native_src/Src/BackendEnv.cpp b/unity/native_src/Src/BackendEnv.cpp index 3568f25740..ac24f01998 100644 --- a/unity/native_src/Src/BackendEnv.cpp +++ b/unity/native_src/Src/BackendEnv.cpp @@ -710,6 +710,7 @@ JSValue esmodule::ExecuteModule(JSContext *ctx, JSValueConst this_val, int argc, if (JS_IsException(EvalRet)) { return EvalRet; } + JS_FreeValue(ctx, EvalRet); auto Namespace = JS_GET_MODULE_NS(ctx, EntryModule); if (JS_IsUndefined(Namespace) || JS_IsNull(Namespace)) {