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
This commit is contained in:
Samuel Susla 2020-06-08 11:55:30 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 7e300db703
Коммит a5386ff4bf
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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<LayoutAnimationDriver>(this);
}
scheduler_ = std::make_shared<Scheduler>(
@ -320,6 +320,7 @@ void Binding::uninstallFabricUIManager() {
std::lock_guard<std::mutex> uiManagerLock(
javaUIManagerMutex_, std::adopt_lock);
animationDriver_ = nullptr;
scheduler_ = nullptr;
javaUIManager_ = nullptr;
reactNativeConfig_ = nullptr;