Skip to content

Memory leak with AnimatorListener #7

@jordicapde

Description

@jordicapde

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:
device-2017-05-19-144937

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions