Skip to content

Commit fd7f5bb

Browse files
zhongwuzwfacebook-github-bot
authored andcommitted
Keep the order of Modals that we can dismiss in sequence (facebook#24961)
Summary: Fixes facebook#16037. We need to keep the order of Modals, if we dismiss Modal randomly(before we use hash table), some Modals may not dismiss successfully. This PR should based on facebook#24959. ## Changelog [iOS] [Fixed] - Keep the order of Modals that we can dismiss in sequence Pull Request resolved: facebook#24961 Differential Revision: D15621858 Pulled By: cpojer fbshipit-source-id: 964729f8f4584995f4e1dd527af4b61534d369ba
1 parent afc142b commit fd7f5bb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

React/Views/RCTModalHostViewManager.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ @interface RCTModalHostViewManager () <RCTModalHostViewInteractor>
4949

5050
@implementation RCTModalHostViewManager
5151
{
52-
NSHashTable *_hostViews;
52+
NSPointerArray *_hostViews;
5353
}
5454

5555
RCT_EXPORT_MODULE()
@@ -59,9 +59,9 @@ - (UIView *)view
5959
RCTModalHostView *view = [[RCTModalHostView alloc] initWithBridge:self.bridge];
6060
view.delegate = self;
6161
if (!_hostViews) {
62-
_hostViews = [NSHashTable weakObjectsHashTable];
62+
_hostViews = [NSPointerArray weakObjectsPointerArray];
6363
}
64-
[_hostViews addObject:view];
64+
[_hostViews addPointer:(__bridge void *)view];
6565
return view;
6666
}
6767

@@ -104,7 +104,7 @@ - (void)invalidate
104104
for (RCTModalHostView *hostView in _hostViews) {
105105
[hostView invalidate];
106106
}
107-
[_hostViews removeAllObjects];
107+
_hostViews = nil;
108108
}
109109

110110
RCT_EXPORT_VIEW_PROPERTY(animationType, NSString)

0 commit comments

Comments
 (0)