Skip to content

Commit d8dd330

Browse files
rocmanfacebook-github-bot-7
authored andcommitted
fix the memory leaks caused by RCTTabBar
Summary: The memory leaks root from the TabBarController not removing itself when its holder view deallocs. So to fix the issue, it’s just to remove it from its parentViewController when the holding RCTTabBar deallocs. This should be safe, since the RCTTabBar seems the owner of the TabBarController. Closes facebook/react-native#3915 Reviewed By: svcscm Differential Revision: D2620905 Pulled By: nicklockwood fb-gh-sync-id: ce22eb3ebf82562827f6b1bae22aea5ac7d3b51a
1 parent f8df384 commit d8dd330

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

React/Views/RCTTabBar.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ - (UIViewController *)reactViewController
5050
- (void)dealloc
5151
{
5252
_tabController.delegate = nil;
53+
[_tabController removeFromParentViewController];
5354
}
5455

5556
- (NSArray<RCTTabBarItem *> *)reactSubviews

0 commit comments

Comments
 (0)