Do not retain RuntimeScheduler beyond Runtime's lifetime

Summary:
changelog: [internal]

Retaining RuntimeScheduler beyond Runtime's lifetime can lead to crashes.

Reviewed By: ShikaSD

Differential Revision: D31084763

fbshipit-source-id: df6dd6fcf5aa224b9465ed7df1e64ad0ca964510
This commit is contained in:
Samuel Susla
2021-09-21 10:22:40 -07:00
committed by Facebook GitHub Bot
parent a7ff7229f0
commit 9a308697e2
3 changed files with 6 additions and 6 deletions
@@ -529,7 +529,7 @@ void Binding::installFabricUIManager(
auto runtimeExecutor = runtimeExecutorHolder->cthis()->get();
if (runtimeSchedulerHolder) {
auto runtimeScheduler = runtimeSchedulerHolder->cthis()->get();
auto runtimeScheduler = runtimeSchedulerHolder->cthis()->get().lock();
if (runtimeScheduler) {
runtimeScheduler->setEnableYielding(config->getBool(
"react_native_new_architecture:runtimescheduler_enable_yielding_android"));