-
Couldn't load subscription status.
- Fork 4k
Open
Description
See here for details: https://py.hashnode.dev/callback-leaks-cancel-your-picasso-requests#heading-weakhashmap
Picasso.targetToActions is a WeakHashMap which prevents leaks in most scenarios, but breaks when providing custom classes such as setting a custom callback in the action with a strong reference to a view.
Consider changing the WeakHashMap<View, Action> to WeakHashMap<View, Void> (i.e. null values) and then storing the actions as view tags with a dedicated int id. That way, the action can only be reached through the view and that will avoid leaks.
Metadata
Metadata
Assignees
Labels
No labels