diff --git a/ReactCommon/react/renderer/uimanager/UIManager.cpp b/ReactCommon/react/renderer/uimanager/UIManager.cpp index a15c46313ab..ea5e77036a0 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.cpp +++ b/ReactCommon/react/renderer/uimanager/UIManager.cpp @@ -341,9 +341,8 @@ void UIManager::configureNextLayoutAnimation( RawValue const &config, jsi::Value const &successCallback, jsi::Value const &failureCallback) const { - auto animationDelegate = animationDelegate_.load(); - if (animationDelegate) { - animationDelegate->uiManagerDidConfigureNextLayoutAnimation( + if (animationDelegate_) { + animationDelegate_->uiManagerDidConfigureNextLayoutAnimation( runtime, config, std::move(successCallback), @@ -431,15 +430,14 @@ void UIManager::setAnimationDelegate(UIManagerAnimationDelegate *delegate) { } void UIManager::stopSurfaceForAnimationDelegate(SurfaceId surfaceId) const { - auto animationDelegate = animationDelegate_.load(); - if (animationDelegate) { - animationDelegate->stopSurface(surfaceId); + if (animationDelegate_ != nullptr) { + animationDelegate_->stopSurface(surfaceId); } } void UIManager::animationTick() { - auto animationDelegate = animationDelegate_.load(); - if (animationDelegate && animationDelegate->shouldAnimateFrame()) { + if (animationDelegate_ != nullptr && + animationDelegate_->shouldAnimateFrame()) { shadowTreeRegistry_.enumerate( [&](ShadowTree const &shadowTree, bool &stop) { shadowTree.notifyDelegatesOfUpdates(); diff --git a/ReactCommon/react/renderer/uimanager/UIManager.h b/ReactCommon/react/renderer/uimanager/UIManager.h index 13729bae024..ebb8a419bd0 100644 --- a/ReactCommon/react/renderer/uimanager/UIManager.h +++ b/ReactCommon/react/renderer/uimanager/UIManager.h @@ -185,7 +185,7 @@ class UIManager final : public ShadowTreeDelegate { SharedComponentDescriptorRegistry componentDescriptorRegistry_; UIManagerDelegate *delegate_; - std::atomic animationDelegate_{nullptr}; + UIManagerAnimationDelegate *animationDelegate_{nullptr}; RuntimeExecutor const runtimeExecutor_{}; ShadowTreeRegistry shadowTreeRegistry_{}; BackgroundExecutor const backgroundExecutor_{};