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

A bug in ImageManagerJob.cancel #91

Closed
Cosebe opened this issue Aug 16, 2014 · 3 comments
Closed

A bug in ImageManagerJob.cancel #91

Cosebe opened this issue Aug 16, 2014 · 3 comments
Labels

Comments

@Cosebe
Copy link

Cosebe commented Aug 16, 2014

I think...

jobs.remove(key);

to

if (jobs.get(key) == this) jobs.remove(key);

in ImageManager.java:488

Because some instances have the same key at one time. In this case, the actual job can't progress.

@sjudd
Copy link
Collaborator

sjudd commented Aug 17, 2014

Thanks for reporting this! I can definitely see how this could happen if presenter A has finished loading an image, and presenter B starts loading the same image, and then presenter A is cleared while presenter B's load is still in progress. Because presenter A's job doesn't do the check you suggest, it ends up removing presenter B's job from the map.

Is that the scenario you were thinking of? Or did you have others in mind?

@Cosebe
Copy link
Author

Cosebe commented Aug 17, 2014

Sorry, I'm not familiar with the English.

Yes, I think you are right.

My project uses android's ListView class and displays items having same image(path) and size.
Because Glide assign a same key if thumbnail images have same size and path, random thumbnail's ImageView sets null value very often.

I spend a lot of time to solve this problem. At last I wrote this issue. This problem was because a certain ImageView's presenter removes the irrelevant job.

I think my problem is similar to your scenario. It often happens when ListView has a small number of items. Maybe ListView's View Reuse Algorithm seems to behave a little differently than the human's.

I love Glide library. I can do a lot of things easier by virtue of your library. Thank you.

sjudd added a commit to sjudd/glide that referenced this issue Aug 17, 2014
@sjudd sjudd closed this as completed in ccab7e9 Aug 17, 2014
sjudd added a commit to sjudd/glide that referenced this issue Aug 17, 2014
@sjudd
Copy link
Collaborator

sjudd commented Aug 17, 2014

Thanks for following up on this, I really appreciate your time and effort!

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

No branches or pull requests

3 participants