Skip to content
Permalink
Browse files
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
  • Loading branch information
rickhanlonii authored and facebook-github-bot committed Feb 11, 2020
1 parent 7bd1abe commit 6ba2aeefa8dfe031bf1dc46dbea29235aec31d61
Showing 1 changed file with 5 additions and 1 deletion.
@@ -70,8 +70,12 @@ - (void)dealloc

- (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];
}
}];
}

0 comments on commit 6ba2aee

Please sign in to comment.