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

Release previous resources after next load? #1501

Closed
yihuanzhou opened this issue Oct 6, 2016 · 1 comment
Closed

Release previous resources after next load? #1501

yihuanzhou opened this issue Oct 6, 2016 · 1 comment
Labels

Comments

@yihuanzhou
Copy link

I have a fairly specific use case question on Glide.

There are instances in my application where I load a new image into a previously used ImageView without a placeholder drawable. This would trigger a clear of the previous request that would release the resources as well as nulling the drawable in the ImageView since there was no placeholder set. I want to avoid this brief period where the ImageView is blank before the new load is complete.

I have tried overriding the onLoadStarted behavior to not set null placeholder drawable but I believe this may lead to the common java.lang.RuntimeException: Canvas: trying to use a recycled bitmap crash since the bitmap referenced by the current ImageView was cleared and may have been recycled by the BitmapPool.

Is there a recommended workaround for this type of issue where we release the previous load's resources until after the next load is complete?

@TWiStErRob
Copy link
Collaborator

#527? Let me know if you need more help.

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

2 participants