From a5386ff4bf8bcad6ac4424d46d15c2d409c71a84 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 8 Jun 2020 11:55:30 -0700 Subject: [PATCH] Delete animation driver when destructing scheduler Summary: Changelog: [Internal] Clean up animationDriver_ in `Binding::uninstallFabricUIManager`. Reviewed By: JoshuaGross Differential Revision: D21923567 fbshipit-source-id: ecdc727ecbfd1d7052be0372b8d2a0ee7172f93f --- .../src/main/java/com/facebook/react/fabric/jni/Binding.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp index 46a91c37761..648272fffc1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Binding.cpp @@ -291,7 +291,7 @@ void Binding::installFabricUIManager( disablePreallocateViews_ = reactNativeConfig_->getBool( "react_fabric:disabled_view_preallocation_android"); - bool enableLayoutAnimations_ = reactNativeConfig_->getBool( + bool enableLayoutAnimations = reactNativeConfig_->getBool( "react_fabric:enabled_layout_animations_android"); auto toolbox = SchedulerToolbox{}; @@ -301,7 +301,7 @@ void Binding::installFabricUIManager( toolbox.synchronousEventBeatFactory = synchronousBeatFactory; toolbox.asynchronousEventBeatFactory = asynchronousBeatFactory; - if (enableLayoutAnimations_) { + if (enableLayoutAnimations) { animationDriver_ = std::make_shared(this); } scheduler_ = std::make_shared( @@ -320,6 +320,7 @@ void Binding::uninstallFabricUIManager() { std::lock_guard uiManagerLock( javaUIManagerMutex_, std::adopt_lock); + animationDriver_ = nullptr; scheduler_ = nullptr; javaUIManager_ = nullptr; reactNativeConfig_ = nullptr;