Skip to content

Commit

Permalink
1、修复内存泄漏问题
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Nov 21, 2024
1 parent e8ab174 commit 6db8715
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public ScaleRelativeLayout(@NonNull Context context, @Nullable AttributeSet attr
invalidateLayout();

});

initPlayer();
}

private void initPlayer(){
Expand Down Expand Up @@ -66,13 +66,19 @@ public void onGlobalLayout() {
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
initPlayer();
if (attacher != null){
attacher.registerDisplayListener();
}
// initPlayer();
}

@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
gsyVideoPlayer = null;
if (attacher != null){
attacher.unRegisterDisplayListener();
}
// gsyVideoPlayer = null;
}

public PhotoViewAttacher getAttacher() {
Expand Down

0 comments on commit 6db8715

Please sign in to comment.