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:
parent
f8df38424e
commit
d8dd330d41
|
@ -50,6 +50,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
|
|||
- (void)dealloc
|
||||
{
|
||||
_tabController.delegate = nil;
|
||||
[_tabController removeFromParentViewController];
|
||||
}
|
||||
|
||||
- (NSArray<RCTTabBarItem *> *)reactSubviews
|
||||
|
|
Loading…
Reference in New Issue