Skip to content

Commit

Permalink
Remove AdsManager listeners on release
Browse files Browse the repository at this point in the history
Issue: #6687
PiperOrigin-RevId: 283023548
  • Loading branch information
andrewlewis authored and ojw28 committed Dec 6, 2019
1 parent 9d9a2a6 commit 5f465f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@
[Cast demo app](https:/google/ExoPlayer/tree/dev-v2/demos/cast).
* TestUtils: Publish the `testutils` module to simplify unit testing with
ExoPlayer ([#6267](https:/google/ExoPlayer/issues/6267)).
* IMA extension: Remove `AdsManager` listeners on release to avoid leaking an
`AdEventListener` provided by the app
([#6687](https:/google/ExoPlayer/issues/6687)).

### 2.10.8 (2019-11-19) ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,11 @@ public void stop() {
public void release() {
pendingAdRequestContext = null;
if (adsManager != null) {
adsManager.removeAdErrorListener(this);
adsManager.removeAdEventListener(this);
if (adEventListener != null) {
adsManager.removeAdEventListener(adEventListener);
}
adsManager.destroy();
adsManager = null;
}
Expand Down

0 comments on commit 5f465f7

Please sign in to comment.