fix(ios): crash on ads after leaving the app (#3911)
This commit is contained in:
parent
dc2a2ab863
commit
3d6bc9409c
@ -247,6 +247,11 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
}
|
}
|
||||||
|
|
||||||
deinit {
|
deinit {
|
||||||
|
#if USE_GOOGLE_IMA
|
||||||
|
_imaAdsManager.releaseAds()
|
||||||
|
_imaAdsManager = nil
|
||||||
|
#endif
|
||||||
|
|
||||||
NotificationCenter.default.removeObserver(self)
|
NotificationCenter.default.removeObserver(self)
|
||||||
self.removePlayerLayer()
|
self.removePlayerLayer()
|
||||||
_playerObserver.clearPlayer()
|
_playerObserver.clearPlayer()
|
||||||
@ -1260,11 +1265,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
|
|||||||
_resouceLoaderDelegate = nil
|
_resouceLoaderDelegate = nil
|
||||||
_playerObserver.clearPlayer()
|
_playerObserver.clearPlayer()
|
||||||
|
|
||||||
#if USE_GOOGLE_IMA
|
|
||||||
_imaAdsManager.releaseAds()
|
|
||||||
_imaAdsManager = nil
|
|
||||||
#endif
|
|
||||||
|
|
||||||
self.removePlayerLayer()
|
self.removePlayerLayer()
|
||||||
|
|
||||||
if let _playerViewController {
|
if let _playerViewController {
|
||||||
|
Loading…
Reference in New Issue
Block a user