From 7dd91d3437952cf19569efce30c823d14bdf6c9d Mon Sep 17 00:00:00 2001 From: Sunbreak Date: Tue, 14 May 2024 04:05:36 -0700 Subject: [PATCH] fix: use local scheduler for thread-safe (#44565) Summary: `getScheduler()` is intended for thread-safe ## Changelog: [Android][FIXED] - local scheduler for thread-safe Pull Request resolved: https://github.com/facebook/react-native/pull/44565 Test Plan: none Reviewed By: fabriziocucci Differential Revision: D57326255 Pulled By: javache fbshipit-source-id: fa3a1df0f2653d5c286fdb537e0d44ab6fd1ed54 --- .../ReactAndroid/src/main/jni/react/fabric/Binding.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp index f34bffc3f23..da8507fd4d5 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/fabric/Binding.cpp @@ -91,7 +91,7 @@ void Binding::setPixelDensity(float pointScaleFactor) { } void Binding::driveCxxAnimations() { - scheduler_->animationTick(); + getScheduler()->animationTick(); } void Binding::reportMount(SurfaceId surfaceId) { @@ -189,7 +189,7 @@ void Binding::startSurfaceWithConstraints( isRTL ? LayoutDirection::RightToLeft : LayoutDirection::LeftToRight; auto surfaceHandler = SurfaceHandler{moduleName->toStdString(), surfaceId}; - surfaceHandler.setContextContainer(scheduler_->getContextContainer()); + surfaceHandler.setContextContainer(scheduler->getContextContainer()); surfaceHandler.setProps(initialProps->consume()); surfaceHandler.constraintLayout(constraints, context);