Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 7db82acd authored by Adam Powell's avatar Adam Powell
Browse files

Fix leaky view tags

The implementation of the method View#setTag(int, Object) stored tag
objects as entries in a static WeakHashMap associated with the View as
a key. This was problematic for any tag object that stored a hard
reference back to the View the tag was placed on, as it would cause
the WeakReference key to never be collected and the entry to persist
forever.

This was particularly nasty if an app used a keyed tag to store a
ViewHolder object referencing child views for use in the Adapter
implementaion for an AdapterView, since child views will always have
hard references leading back to the parent.

Change-Id: Ia17840a301ba0e0c928861405388fb2f625dac2c
parent e94d950d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment