Permalink
Browse files

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 #9295

Differential Revision: D3686214

fbshipit-source-id: ec0caac99d231786eefad023f3f0ed44a79f687e
  • Loading branch information...
1 parent 55b76b1 commit 915345bd012d1b256e80e77e4a1f959b536eb3e6 @Roshanjossey Roshanjossey committed with Facebook Github Bot 3 Aug 8, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 React/Views/RCTModalHostViewManager.m
@@ -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];

0 comments on commit 915345b

Please sign in to comment.