Skip to content

Commit

Permalink
fix(ios): crash on ads after leaving the app (#3911)
Browse files Browse the repository at this point in the history
  • Loading branch information
freeboub authored Jun 20, 2024
1 parent dc2a2ab commit 3d6bc94
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3d6bc94

Please sign in to comment.