fix(jsc): fix jscctx finalize crash (#4154)

This commit is contained in:
etkmao
2024-12-25 11:44:30 +08:00
committed by GitHub
parent 434b3c08f4
commit 4ba13cc8be
+1 -1
View File
@@ -66,13 +66,13 @@ JSCCtx::JSCCtx(JSContextGroupRef group, std::weak_ptr<VM> 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,