Skip to content

Commit

Permalink
Merge pull request #1086 from openkraken/fix/stack_overflow
Browse files Browse the repository at this point in the history
fix: fix stack overflow with multiple thread.
  • Loading branch information
answershuto authored Jan 12, 2022
2 parents c4fe355 + a689caa commit 66c911e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bridge/bindings/qjs/executing_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 66c911e

Please sign in to comment.