From 4ba13cc8bebdf652ec288a4aa6167dc46016b591 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 cff6d1626..293cc106e 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,