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
Loading
Please register or sign in to comment