mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Use atomic pointer for animationDelegate_ to prevent race during teardown"
Summary: Changelog: [internal] Original commit changeset: 6cb898caf7c2 This change doesn't fix LayoutAnimation crashes. Let's back it out. Reviewed By: fkgozali Differential Revision: D29909973 fbshipit-source-id: 34926ace220e6b269bb938a3da72c977b0608187
This commit is contained in:
committed by
Facebook GitHub Bot
parent
cfd425406a
commit
110ef5bf30
@@ -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();
|
||||
|
||||
@@ -185,7 +185,7 @@ class UIManager final : public ShadowTreeDelegate {
|
||||
|
||||
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
|
||||
UIManagerDelegate *delegate_;
|
||||
std::atomic<UIManagerAnimationDelegate *> animationDelegate_{nullptr};
|
||||
UIManagerAnimationDelegate *animationDelegate_{nullptr};
|
||||
RuntimeExecutor const runtimeExecutor_{};
|
||||
ShadowTreeRegistry shadowTreeRegistry_{};
|
||||
BackgroundExecutor const backgroundExecutor_{};
|
||||
|
||||
Reference in New Issue
Block a user