Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix EXC_BAD_ACCESS crash on iOS in [REAAnimationsManager clearSharedTransitionConfigForTag:] #5975

Merged
merged 2 commits into from
May 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions apple/LayoutReanimation/REAAnimationsManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
return YES;
}

for (id<RCTComponent> subview in view.reactSubviews) {

Check warning on line 22 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (subview)

Check warning on line 22 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Subviews)
if (REANodeFind(subview, block)) {

Check warning on line 23 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (subview)
return YES;
}
}
Expand All @@ -34,7 +34,7 @@
NSMutableSet<NSNumber *> *_enteringViews;
NSMutableDictionary<NSNumber *, REASnapshot *> *_enteringViewTargetValues;
NSMutableDictionary<NSNumber *, REAUIView *> *_exitingViews;
NSMutableDictionary<NSNumber *, NSNumber *> *_exitingSubviewsCountMap;

Check warning on line 37 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Subviews)
NSMutableDictionary<NSNumber *, NSNumber *> *_exitingParentTags;
NSMutableSet<NSNumber *> *_ancestorsToRemove;
NSMutableArray<NSString *> *_targetKeys;
Expand All @@ -45,7 +45,7 @@
REAAnimationRemovingBlock _clearAnimationConfigForTag;
REASharedTransitionRemovingBlock _clearSharedTransitionConfigForTag;
REASharedTransitionManager *_sharedTransitionManager;
#ifndef NDEBUG

Check warning on line 48 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (ifndef)

Check warning on line 48 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (NDEBUG)
REACheckDuplicateSharedTagBlock _checkDuplicateSharedTag;
#endif
}
Expand All @@ -60,12 +60,12 @@
return _array;
}

- (instancetype)initWithUIManager:(RCTUIManager *)uiManager

Check warning on line 63 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (instancetype)
{
if (self = [super init]) {
_uiManager = uiManager;
_exitingViews = [NSMutableDictionary new];
_exitingSubviewsCountMap = [NSMutableDictionary new];

Check warning on line 68 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Subviews)
_ancestorsToRemove = [NSMutableSet new];
_exitingParentTags = [NSMutableDictionary new];
_enteringViews = [NSMutableSet new];
Expand All @@ -77,8 +77,8 @@
[_targetKeys addObject:[NSString stringWithFormat:@"target%@", [key capitalizedString]]];
[_currentKeys addObject:[NSString stringWithFormat:@"current%@", [key capitalizedString]]];
}
_sharedTransitionManager = [[REASharedTransitionManager alloc] initWithAnimationsManager:self];

Check warning on line 80 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (alloc)
_reaSwizzledUIManager = [[REASwizzledUIManager alloc] initWithUIManager:uiManager withAnimationManager:self];

Check warning on line 81 in apple/LayoutReanimation/REAAnimationsManager.m

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (alloc)

_startAnimationForTag = ^(NSNumber *tag, LayoutAnimationType type, NSDictionary *yogaValues) {
// default implementation, this block will be replaced by a setter
Expand All @@ -94,6 +94,9 @@
_clearAnimationConfigForTag = ^(NSNumber *tag) {
// default implementation, this block will be replaced by a setter
};
_clearSharedTransitionConfigForTag = ^(NSNumber *tag) {
// default implementation, this block will be replaced by a setter
};
#ifndef NDEBUG
_checkDuplicateSharedTag = ^(REAUIView *view, NSNumber *viewTag) {
// default implementation, this block will be replaced by a setter
Expand Down