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

ExoUserPlayer中强引用activity会导致内存泄漏哦 #147

Closed
h3clikejava opened this issue Jul 23, 2018 · 4 comments
Closed

ExoUserPlayer中强引用activity会导致内存泄漏哦 #147

h3clikejava opened this issue Jul 23, 2018 · 4 comments

Comments

@h3clikejava
Copy link

Leaks会报错
image

@yangchaojiang
Copy link
Owner

检查你的使用没有释放相应资源? 没有肯定释放肯定要

@yangchaojiang
Copy link
Owner

image
看你的截图使用单例模式,单例使用不当的话,容易造成activity 无法正确释放的

@h3clikejava
Copy link
Author

h3clikejava commented Jul 25, 2018

大哥我这是实例,不是单例!而且ExoUserPlayer类的releasePlayers方法没有释放activity对象,肯定是会泄漏的啊。
我觉得你这里应该要么是releasePlayers方法中释放activity的引用,要么用软引用才对啊,作为一个库一直强引用activity不好吧。

@yangchaojiang yangchaojiang reopened this Jul 26, 2018
@yangchaojiang
Copy link
Owner

版本2.1.91

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

2 participants