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 https://github.com/facebook/react-native/pull/3915

Reviewed By: svcscm

Differential Revision: D2620905

Pulled By: nicklockwood

fb-gh-sync-id: ce22eb3ebf82562827f6b1bae22aea5ac7d3b51a
This commit is contained in:
rocman 2015-11-05 08:57:50 -08:00 committed by facebook-github-bot-7
parent f8df38424e
commit d8dd330d41
1 changed files with 1 additions and 0 deletions

View File

@ -50,6 +50,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
- (void)dealloc
{
_tabController.delegate = nil;
[_tabController removeFromParentViewController];
}
- (NSArray<RCTTabBarItem *> *)reactSubviews