From ab54c7a949c7e91ef68cba4f9b6e7bf4d9ef80ff Mon Sep 17 00:00:00 2001 From: etkmao Date: Tue, 24 Dec 2024 21:53:03 +0800 Subject: [PATCH] fix(jsc): fix jscctx finalize crash --- 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,