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:
Roshan Jossey 2016-08-08 15:53:53 -07:00 committed by Facebook Github Bot 3
parent 55b76b1798
commit 915345bd01
1 changed files with 1 additions and 1 deletions

View File

@ -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];