Skip to content

Commit

Permalink
Merge pull request #1827 from nfb-onf/fix-playerviewcontroller-keypat…
Browse files Browse the repository at this point in the history
…h-leak

Fix playerviewcontroller keypath leak of observers
  • Loading branch information
ashnfb authored Nov 19, 2019
2 parents 257be24 + fa20965 commit 2c5006a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ios/Video/RCTVideo.m
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,11 @@ - (void)videoPlayerViewControllerWillDismiss:(AVPlayerViewController *)playerVie
{
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});
}
}
Expand Down

0 comments on commit 2c5006a

Please sign in to comment.