LoaderImageView leaks memory
passiondroid opened this issue · comments
It is unlikely LoaderImageView itself leaks. The mContext passed to it, is like any context pass to ImageView. LoaderImageView itself doesn't use the mContext, but the ImageView (which it inherits does). In normal case, the LoaderImageView (ImageView) would be destroy when HomeActivity is destroy.
The only possible exception is you have load some drawable object to the ImageView, here the object lives longer than HomeActivity. Hence this preventing ImageView (or LoaderImageView) from being destroy when HomeActivity is destroyed. And with that, the mContext it holds leaks.
Check out this blog post http://www.curious-creature.com/2008/12/18/avoid-memory-leaks-on-android/ by Roman Guy.