Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't call jsQueue->quitSynchronous() immediately after construction #6781

Merged
merged 3 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ WorkletsModuleProxy::WorkletsModuleProxy(
valueUnpackerCode_(valueUnpackerCode),
jsQueue_(jsQueue) {}

WorkletsModuleProxy::~WorkletsModuleProxy() {}
WorkletsModuleProxy::~WorkletsModuleProxy() {
jsQueue_->quitSynchronous();
}

jsi::Value WorkletsModuleProxy::makeShareableClone(
jsi::Runtime &rt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ ReanimatedHermesRuntime::ReanimatedHermesRuntime(
auto adapter =
std::make_unique<HermesExecutorRuntimeAdapter>(*runtime_, jsQueue);
debugToken_ = chrome::enableDebugging(std::move(adapter), name);
#else
// This is required by iOS, because there is an assertion in the destructor
// that the thread was indeed `quit` before
jsQueue->quitSynchronous();
#endif // HERMES_ENABLE_DEBUGGER

#ifndef NDEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,17 @@ std::shared_ptr<jsi::Runtime> ReanimatedRuntime::make(
const std::string &name) {
(void)rnRuntime; // used only for V8
#if JS_RUNTIME_HERMES
// We don't call `jsQueue->quitSynchronous()` here, since it will be done
// later in ReanimatedHermesRuntime

auto runtime = facebook::hermes::makeHermesRuntime();
return std::make_shared<ReanimatedHermesRuntime>(
std::move(runtime), jsQueue, name);
#elif JS_RUNTIME_V8
// This is required by iOS, because there is an assertion in the destructor
// that the thread was indeed `quit` before.
jsQueue->quitSynchronous();

(void)jsQueue;
auto config = std::make_unique<rnv8::V8RuntimeConfig>();
config->enableInspector = false;
config->appName = name;
return rnv8::createSharedV8Runtime(&rnRuntime, std::move(config));
#else
// This is required by iOS, because there is an assertion in the destructor
// that the thread was indeed `quit` before
jsQueue->quitSynchronous();

(void)jsQueue;
return facebook::jsc::makeJSCRuntime();
#endif
}
Expand Down
Loading