Skip to content

Commit

Permalink
Avoid memory leaks by removing callbacks from surface when SimpleExoP…
Browse files Browse the repository at this point in the history
…layer is released.

Without this developers which reuse a SurfaceHolder with multiple instances of
SimpleExoPlayer need to call simpleExoPlayer.setVideoSurfaceHolder(null) to get
the SimpleExoPlayer.ComponentListener removed from the surface holder. If they
don't, the component listener is still registered and as a member class leaks
an instance of simpleExoPlayer.

Issue #1855

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135292439
  • Loading branch information
[]inger authored and ojw28 committed Oct 6, 2016
1 parent d334dfd commit 08965c0
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ public void stop() {
@Override
public void release() {
player.release();
removeSurfaceCallbacks();
}

@Override
Expand Down

0 comments on commit 08965c0

Please # to comment.