diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift index e7c73e8e..25bae29d 100644 --- a/ios/Video/RCTVideo.swift +++ b/ios/Video/RCTVideo.swift @@ -247,6 +247,11 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH } deinit { + #if USE_GOOGLE_IMA + _imaAdsManager.releaseAds() + _imaAdsManager = nil + #endif + NotificationCenter.default.removeObserver(self) self.removePlayerLayer() _playerObserver.clearPlayer() @@ -1260,11 +1265,6 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH _resouceLoaderDelegate = nil _playerObserver.clearPlayer() - #if USE_GOOGLE_IMA - _imaAdsManager.releaseAds() - _imaAdsManager = nil - #endif - self.removePlayerLayer() if let _playerViewController {