Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

内存泄漏问题 #180

Open
aillience opened this issue Oct 19, 2021 · 0 comments
Open

内存泄漏问题 #180

aillience opened this issue Oct 19, 2021 · 0 comments

Comments

@aillience
Copy link

由于是自定义view的toast,所以在传入context的时候,传入了activity。但是在实际操作中,activity可能已经被销毁,从而导致内存泄漏。
if (!allowQueue){
if (lastToast != null)
lastToast.cancel();//这里的lastToast可能持有一个已经销毁的activity对象。建议优化
lastToast = currentToast;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant