From a689caae3172c9d84a3862dd7acd181e3a06623c Mon Sep 17 00:00:00 2001 From: "chenghuai.dtc" Date: Wed, 12 Jan 2022 13:28:51 +0800 Subject: [PATCH] fix: fix stack overflow with multiple thread. --- bridge/bindings/qjs/executing_context.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bridge/bindings/qjs/executing_context.cc b/bridge/bindings/qjs/executing_context.cc index fea22013e0..b356ddd619 100644 --- a/bridge/bindings/qjs/executing_context.cc +++ b/bridge/bindings/qjs/executing_context.cc @@ -63,6 +63,8 @@ ExecutionContext::ExecutionContext(int32_t contextId, const JSExceptionHandler& if (m_runtime == nullptr) { m_runtime = JS_NewRuntime(); } + // Avoid stack overflow when running in multiple threads. + JS_UpdateStackTop(m_runtime); m_ctx = JS_NewContext(m_runtime); timeOrigin = std::chrono::system_clock::now();