-
Notifications
You must be signed in to change notification settings - Fork 30
Memory leak with AnimatorListener #7
Description
I have found a memory leak using the DotLoader library. I tried with a minimal case (which was a simple activity with a DotLoader) as a test and it happened too, so it seems to be a common issue.
My simple test case includes a single activity with a layout as follows:
<LinearLayout
...>
<Button
.../>
<com.bhargavms.dotloader.DotLoader
.../>
</LinearLayout>And within the activity, the only thing that I'm doing is firing a new Intent to the same activity when I click the button. Whenever you click the button, the old activity is leaked.
I used LeakCanary and I copy a snapshot of the report:

There seems to be something wrong with the AnimatorListeners which are added at createValueAnimatorForDot, but actually I don't know where the exact problem and solution are (maybe the listener shouldn't be instantiated anonymously, so it can be removed later).