Fix memory leak bug in RCTModalHost
Summary: This PR addresses issue #9265. Negated the condition that checks if `_hostViews` exists so that `_hostViews` will be allocated only if it doesn't exist Closes https://github.com/facebook/react-native/pull/9295 Differential Revision: D3686214 fbshipit-source-id: ec0caac99d231786eefad023f3f0ed44a79f687e
This commit is contained in:
parent
55b76b1798
commit
915345bd01
|
@ -42,7 +42,7 @@ RCT_EXPORT_MODULE()
|
|||
- (UIView *)view
|
||||
{
|
||||
UIView *view = [[RCTModalHostView alloc] initWithBridge:self.bridge];
|
||||
if (_hostViews) {
|
||||
if (!_hostViews) {
|
||||
_hostViews = [NSHashTable weakObjectsHashTable];
|
||||
}
|
||||
[_hostViews addObject:view];
|
||||
|
|
Loading…
Reference in New Issue