mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Make scheduler into unique_ptr instead of shared_ptr
Summary: Changelog: [Internal] RCTScheduler was storing Scheduler as `shared_ptr`, but `RCTScheduler` is sole owner of it. `unique_ptr` better expresses this ownership. Reviewed By: JoshuaGross Differential Revision: D21923573 fbshipit-source-id: e382f2d6e0a4875e1441b6063c1ad7056b338e29
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9c32140068
commit
3bf3f63a4d
@@ -95,7 +95,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
||||
};
|
||||
|
||||
@implementation RCTScheduler {
|
||||
std::shared_ptr<Scheduler> _scheduler;
|
||||
std::unique_ptr<Scheduler> _scheduler;
|
||||
std::shared_ptr<LayoutAnimationDriver> _animationDriver;
|
||||
std::shared_ptr<SchedulerDelegateProxy> _delegateProxy;
|
||||
std::shared_ptr<LayoutAnimationDelegateProxy> _layoutAnimationDelegateProxy;
|
||||
@@ -120,7 +120,7 @@ class LayoutAnimationDelegateProxy : public LayoutAnimationStatusDelegate, publi
|
||||
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());
|
||||
}
|
||||
|
||||
_scheduler = std::make_shared<Scheduler>(
|
||||
_scheduler = std::make_unique<Scheduler>(
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user