fix crash on reload during animation
Summary: closes #11719 **Test plan (required)** Cmd+r during native animation in uiexplorer Closes https://github.com/facebook/react-native/pull/11720 Differential Revision: D4386449 fbshipit-source-id: a7b5ea2c77de260e8b95b5983438f9cef4d1d752
This commit is contained in:
parent
07a2a71df3
commit
e8a45c96a7
|
@ -20,6 +20,11 @@ typedef void (^AnimatedOperation)(RCTNativeAnimatedNodesManager *nodesManager);
|
|||
|
||||
RCT_EXPORT_MODULE();
|
||||
|
||||
- (void)invalidate
|
||||
{
|
||||
[_nodesManager stopAnimationLoop];
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self.bridge.eventDispatcher removeDispatchObserver:self];
|
||||
|
|
|
@ -60,6 +60,8 @@
|
|||
|
||||
- (void)stopAnimation:(nonnull NSNumber *)animationId;
|
||||
|
||||
- (void)stopAnimationLoop;
|
||||
|
||||
// events
|
||||
|
||||
- (void)addAnimatedEventToView:(nonnull NSNumber *)viewTag
|
||||
|
|
|
@ -321,7 +321,14 @@
|
|||
|
||||
- (void)stopAnimationLoopIfNeeded
|
||||
{
|
||||
if (_displayLink && _activeAnimations.count == 0) {
|
||||
if (_activeAnimations.count == 0) {
|
||||
[self stopAnimationLoop];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)stopAnimationLoop
|
||||
{
|
||||
if (_displayLink) {
|
||||
[_displayLink invalidate];
|
||||
_displayLink = nil;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue