Skip to content

Commit bdfa638

Browse files
committed
fix: memory leak
1 parent a9a6c11 commit bdfa638

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

native/cpp/quickjs_wrapper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ jsModuleLoaderFunc(JSContext *ctx, const char *module_name, void *opaque) {
238238
int scriptLen = env->GetStringUTFLength((jstring) result);
239239
JSValue func_val = JS_Eval(ctx, script, scriptLen, module_name,
240240
JS_EVAL_TYPE_MODULE | JS_EVAL_FLAG_COMPILE_ONLY);
241+
env->ReleaseStringUTFChars((jstring)(result), script);
241242
if (JS_IsException(func_val)) {
242243
JS_FreeValue(ctx, func_val);
243244
throwJSException(env, ctx);

0 commit comments

Comments
 (0)