销毁开播Activity时清理静态ViewHolder

This commit is contained in:
zlzw 2022-09-13 18:27:05 +08:00
parent b515e9eea2
commit 18069a726d

View File

@ -136,6 +136,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
public static int backIndex = 0;//0=未判断1=已判断 public static int backIndex = 0;//0=未判断1=已判断
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
return R.layout.activity_live_anchor; return R.layout.activity_live_anchor;
@ -850,6 +851,18 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
protected void onDestroy() { protected void onDestroy() {
LiveHttpUtil.cancel(LiveHttpConsts.ANCHOR_CHECK_LIVE); LiveHttpUtil.cancel(LiveHttpConsts.ANCHOR_CHECK_LIVE);
super.onDestroy(); super.onDestroy();
if(mLivePushViewHolder!=null) {
mLivePushViewHolder.onDestroy();
}
if(mLiveReadyViewHolder!=null){
mLiveReadyViewHolder.onDestroy();
}
if(mLiveAnchorViewHolder!=null){
mLiveAnchorViewHolder.onDestroy();
}
mLivePushViewHolder=null;
mLiveReadyViewHolder=null;
mLiveAnchorViewHolder=null;
L.e("LiveAnchorActivity-------onDestroy------->"); L.e("LiveAnchorActivity-------onDestroy------->");
} }