Fix memory leak when using AVPlayerViewController, make sure to release player
This commit is contained in:
parent
3a7be63de3
commit
3d2a58a8c5
@ -1491,6 +1491,8 @@ static int const RCTVideoUnset = -1;
|
|||||||
[_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"];
|
[_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"];
|
||||||
[_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath];
|
[_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath];
|
||||||
[_playerViewController.view removeFromSuperview];
|
[_playerViewController.view removeFromSuperview];
|
||||||
|
_playerViewController.rctDelegate = nil;
|
||||||
|
_playerViewController.player = nil;
|
||||||
_playerViewController = nil;
|
_playerViewController = nil;
|
||||||
|
|
||||||
[self removePlayerTimeObserver];
|
[self removePlayerTimeObserver];
|
||||||
|
Loading…
Reference in New Issue
Block a user