From c21ae91c5a09736280fa9e0a130368bc8b20c716 Mon Sep 17 00:00:00 2001 From: etkmao Date: Wed, 25 Dec 2024 11:44:30 +0800 Subject: [PATCH] fix(jsc): fix jscctx finalize crash (#4154) --- driver/js/src/napi/jsc/jsc_ctx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/driver/js/src/napi/jsc/jsc_ctx.cc b/driver/js/src/napi/jsc/jsc_ctx.cc index cff6d1626df..293cc106e6e 100644 --- a/driver/js/src/napi/jsc/jsc_ctx.cc +++ b/driver/js/src/napi/jsc/jsc_ctx.cc @@ -66,13 +66,13 @@ JSCCtx::JSCCtx(JSContextGroupRef group, std::weak_ptr vm): vm_(vm) { } JSCCtx::~JSCCtx() { - JSGlobalContextRelease(context_); for (auto& [key, item] : constructor_data_holder_) { item->prototype = nullptr; if (global_constructor_data_mgr) { global_constructor_data_mgr->ClearConstructorDataPtr(item.get()); } } + JSGlobalContextRelease(context_); } JSValueRef InvokeJsCallback(JSContextRef ctx,