diff --git a/React/Fabric/RCTScheduler.mm b/React/Fabric/RCTScheduler.mm index 67afffa3b0f..da0a3a5ca5f 100644 --- a/React/Fabric/RCTScheduler.mm +++ b/React/Fabric/RCTScheduler.mm @@ -95,7 +95,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi }; @implementation RCTScheduler { - std::shared_ptr _scheduler; + std::unique_ptr _scheduler; std::shared_ptr _animationDriver; std::shared_ptr _delegateProxy; std::shared_ptr _layoutAnimationDelegateProxy; @@ -120,7 +120,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi _uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get()); } - _scheduler = std::make_shared( + _scheduler = std::make_unique( toolbox, (_animationDriver ? _animationDriver.get() : nullptr), _delegateProxy.get()); } @@ -138,8 +138,6 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi _animationDriver->setLayoutAnimationStatusDelegate(nullptr); } _animationDriver = nullptr; - - _scheduler->setDelegate(nullptr); } - (void)startSurfaceWithSurfaceId:(SurfaceId)surfaceId