WaitingDots icon indicating copy to clipboard operation
WaitingDots copied to clipboard

Memory Leak

Open julioyg opened this issue 8 years ago • 6 comments

Using you library in our project (thanks a lot for it) in which we use CanaryLeak I've found two leaks in your code:

  1. There are some anonymous AnimatorUpdateListener defined that holds a reference to the context.
  2. There are some anonymous TypeEvaluator implementations that because they holds references to their parent class and this one to the context leak memory too.

julioyg avatar May 09 '16 11:05 julioyg

PR: https://github.com/tajchert/WaitingDots/pull/11

julioyg avatar May 09 '16 11:05 julioyg

How about PR: #6 ? Isn't it better? I didn't have enough time to check all commits related to #6

tajchert avatar May 09 '16 12:05 tajchert

looks great! you have any forecast or should we just download the code and work with it instead using the one in jcenter?

julioyg avatar May 09 '16 12:05 julioyg

I just checked as it works fine, didn't have time to find leaks and verify that those commits indeed solves particular leaks. If you can you can test it for leaks you have found, and ping me here with verdict if it works fine - I will merge it at that point if everything is fine. Just need somebody else to confirm it :)

tajchert avatar May 09 '16 14:05 tajchert

checked https://github.com/tajchert/WaitingDots/pull/6:, leaks memory too because of the AnimatorUpdateListeners on the animators, the are never being removed

This is the screenshot I get from LeakCanary(which usually helps me more than the log)

image

julioyg avatar May 10 '16 09:05 julioyg

I've merged your #11 PR, as #6 is still getting some leaks and (sorry to say) I currently don't have time to go through it - anybody willing do fix other leaks (if there are any) are more than welcome.

tajchert avatar May 10 '16 19:05 tajchert