Remove AdsManager listeners on release
Issue: #6687 PiperOrigin-RevId: 283023548
This commit is contained in:
parent
1536a2ceea
commit
a0736cfbf5
@ -157,6 +157,9 @@
|
|||||||
[Cast demo app](https://github.com/google/ExoPlayer/tree/dev-v2/demos/cast).
|
[Cast demo app](https://github.com/google/ExoPlayer/tree/dev-v2/demos/cast).
|
||||||
* TestUtils: Publish the `testutils` module to simplify unit testing with
|
* TestUtils: Publish the `testutils` module to simplify unit testing with
|
||||||
ExoPlayer ([#6267](https://github.com/google/ExoPlayer/issues/6267)).
|
ExoPlayer ([#6267](https://github.com/google/ExoPlayer/issues/6267)).
|
||||||
|
* IMA extension: Remove `AdsManager` listeners on release to avoid leaking an
|
||||||
|
`AdEventListener` provided by the app
|
||||||
|
([#6687](https://github.com/google/ExoPlayer/issues/6687)).
|
||||||
|
|
||||||
### 2.10.8 (2019-11-19) ###
|
### 2.10.8 (2019-11-19) ###
|
||||||
|
|
||||||
|
@ -646,6 +646,11 @@ public final class ImaAdsLoader
|
|||||||
public void release() {
|
public void release() {
|
||||||
pendingAdRequestContext = null;
|
pendingAdRequestContext = null;
|
||||||
if (adsManager != null) {
|
if (adsManager != null) {
|
||||||
|
adsManager.removeAdErrorListener(this);
|
||||||
|
adsManager.removeAdEventListener(this);
|
||||||
|
if (adEventListener != null) {
|
||||||
|
adsManager.removeAdEventListener(adEventListener);
|
||||||
|
}
|
||||||
adsManager.destroy();
|
adsManager.destroy();
|
||||||
adsManager = null;
|
adsManager = null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user