mirror of
https://github.com/samsonjs/media.git
synced 2026-04-06 11:25:46 +00:00
Avoid memory leaks by removing callbacks from surface when SimpleExoPlayer 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
This commit is contained in:
parent
d334dfdcba
commit
08965c03d0
1 changed files with 1 additions and 0 deletions
|
|
@ -456,6 +456,7 @@ public final class SimpleExoPlayer implements ExoPlayer {
|
|||
@Override
|
||||
public void release() {
|
||||
player.release();
|
||||
removeSurfaceCallbacks();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in a new issue