Skip to content

Commit

Permalink
Fix memory leak bug in RCTModalHost
Browse files Browse the repository at this point in the history
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 #9295

Differential Revision: D3686214

fbshipit-source-id: ec0caac99d231786eefad023f3f0ed44a79f687e
  • Loading branch information
Roshan Jossey authored and Facebook Github Bot 3 committed Aug 8, 2016
1 parent 55b76b1 commit 915345b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion React/Views/RCTModalHostViewManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ @implementation RCTModalHostViewManager
- (UIView *)view
{
UIView *view = [[RCTModalHostView alloc] initWithBridge:self.bridge];
if (_hostViews) {
if (!_hostViews) {
_hostViews = [NSHashTable weakObjectsHashTable];
}
[_hostViews addObject:view];
Expand Down

0 comments on commit 915345b

Please sign in to comment.