From 94996372e7a2d015fc1566ab8786c31d522d9b2c Mon Sep 17 00:00:00 2001 From: LinGuanHong <913337456@qq.com> Date: Wed, 29 Nov 2017 10:53:51 +0800 Subject: [PATCH] add one more release memory point mSurfaceHolder.removeCallback(this); mSurfaceHolder = null; --- .../com/example/wechatsmallvideoview/SurfaceVideoView.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wechatsmallvideoview/src/main/java/com/example/wechatsmallvideoview/SurfaceVideoView.java b/wechatsmallvideoview/src/main/java/com/example/wechatsmallvideoview/SurfaceVideoView.java index 742c500..e86064e 100644 --- a/wechatsmallvideoview/src/main/java/com/example/wechatsmallvideoview/SurfaceVideoView.java +++ b/wechatsmallvideoview/src/main/java/com/example/wechatsmallvideoview/SurfaceVideoView.java @@ -312,6 +312,10 @@ public boolean isPlaying() { public void release() { mTargetState = STATE_RELEASED; mCurrentState = STATE_RELEASED; + try{ + mSurfaceHolder.removeCallback(this); + mSurfaceHolder = null; + }catch (Exception ignore){} if (mMediaPlayer != null) { try { mMediaPlayer.release();