mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
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…
x
Reference in New Issue
Block a user