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
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: