You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a LazyColumn where an image is loaded with Glide in each item. And I've noticed that the memory cache is never used in that case because a new FlowCustomTarget is used for each new item and it's never cleared, preventing the resource from being added to the memory cache.
Also the target is not cleared when the flow is closed and there's this comment in the awaitClose block:
// intentionally do not clear using the Glide.clear for recycling internal bitmaps.
Expected Behavior:
I expect the resources to be cached in memory when they are not visible anymore so that they can be later retrieved.
The text was updated successfully, but these errors were encountered:
Hey @guillaume-tgl, this is a little bit more tricky than expected solution because Glide is not allowed to use a recycled bitmap. You can easily reproduce this issue by changing the comment with Glide.clear function with LazyColumn and LazyRow in the demo project.
Do you use a key parameter in LazyColumn for identifying each item?
Hey @guillaume-tgl, I was thinking of this a bit, and I tweaked it a bit to clear the target out of the scope. It's available in the snapshot right now, and it will be included in the next release.
Please complete the following information:
Describe the Bug:
I have a LazyColumn where an image is loaded with Glide in each item. And I've noticed that the memory cache is never used in that case because a new
FlowCustomTarget
is used for each newitem
and it's never cleared, preventing the resource from being added to the memory cache.Also the target is not cleared when the flow is closed and there's this comment in the
awaitClose
block:Expected Behavior:
I expect the resources to be cached in memory when they are not visible anymore so that they can be later retrieved.
The text was updated successfully, but these errors were encountered: