JakeWharton/NineOldAndroids — pull request #16 by BeowulfBjornson (2012-03-25 20:04:57+00:00)
Title: Fixes memory leaks on ViewPropertyAnimator

Using a WeakReference only on the AnimatorProxy class wasn't enough to fix all MemoryLeaks. Hard references to the view on pre-HC and HC were also causing it to leak memory, as well as the pointer to the native instance on the ICS implementation.

The AnimatorListeners were also causing a memory leak, because if they referenced an object in their implementation, it would not get cleaned by the Garbage Collector. They are being nulled after the last animation finishes, so the view can be cleaned normally. Also, it doesn't make much sense for the way to class works to keep the listener after the animation has finished, as you would usually chain all methods in a single call and forget about it.