LogBox - Deallocate _rootViewController to release surface reference and break cycle

Summary:
This def breaks a reference cycle in logbox causing a memory leak in development.

Changelog: [iOS] [Fix] LogBox - Fix dependency cycle

Reviewed By: PeteTheHeat

Differential Revision: D19768068

fbshipit-source-id: 518b9c66499aa092465a9213f955965bffeebd88
This commit is contained in:
Rick Hanlon
2020-02-11 06:58:15 -08:00
committed by Facebook Github Bot
parent 7bd1abec35
commit 6ba2aeefa8
+5 -1
View File
@@ -70,8 +70,12 @@
- (void)show
{
__weak __typeof(self) weakSelf = self;
[RCTSharedApplication().delegate.window.rootViewController presentViewController:_rootViewController animated:NO completion:^{
[self->_rootViewController.view becomeFirstResponder];
__strong __typeof(self) strongSelf = weakSelf;
if (strongSelf) {
[strongSelf->_rootViewController.view becomeFirstResponder];
}
}];
}