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

SkinManager attach 方法逻辑有问题 #20

Open
victor-chan opened this issue Nov 8, 2016 · 1 comment
Open

SkinManager attach 方法逻辑有问题 #20

victor-chan opened this issue Nov 8, 2016 · 1 comment

Comments

@victor-chan
Copy link

SkinManager attach方法关于observer是否已经add的判断有问题
if(!skinObservers.contains(skinObservers)){
skinObservers.add(observer);
}

@alamide0
Copy link

alamide0 commented Apr 27, 2017

嗯应该改为
@OverRide
public void attach(ISkinUpdate observer) {
if(skinObservers == null){
skinObservers = new ArrayList();
}
if(!skinObservers.contains(observer)){
skinObservers.add(observer);
}
}
否则会引起内存泄漏,最终会导致OOM,我的线上APP就遇到了这个问题

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