Merge pull request #1827 from nfb-onf/fix-playerviewcontroller-keypath-leak

Fix playerviewcontroller keypath leak of observers
This commit is contained in:
Ash Mishra 2019-11-19 13:47:15 -08:00 committed by GitHub
commit 2c5006ac50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1381,6 +1381,11 @@ static int const RCTVideoUnset = -1;
{
if (_playerViewController == playerViewController && _fullscreenPlayerPresented && self.onVideoFullscreenPlayerWillDismiss)
{
@try{
[_playerViewController.contentOverlayView removeObserver:self forKeyPath:@"frame"];
[_playerViewController removeObserver:self forKeyPath:readyForDisplayKeyPath];
}@catch(id anException){
}
self.onVideoFullscreenPlayerWillDismiss(@{@"target": self.reactTag});
}
}