Closed SebRut closed 5 years ago
Consider Window is only been referenced by the animator, after animator finish, window can be release. so it is a temporary leak. I think you can ignore it.
And i will also add WeakReference to window in next version.
Please check v2.3.2
I probably will not be able to actually test this before monday, but I think that a reference to window
is still bound to the AnimatorUpdateListener
. I guess passing the WeakRef to startColorAnimation
and doing Window window = windowWeakRef.get();"
in onAnimationUpdate
could resolve this issue.
In relation to this you might be able to remove that AnimatorUpdateListener
in onAnimationUpdate
if window == null
.
I just checked out 2.3.2 and window is still leaking.
...Let me check with LeakCanary and fix it later.
I find that i'm wrong, this is a big memory leak and window will leak forever. Please check 2.3.3, i test it with LeakCanary and it look like fixed.
Seems to be fixed for me
LeakCanary reports sAnimator leaking window in startColorAnimation. This could probably be fixed by using a WeakReference to access window or by cancelling the Animator when the corresponding activity is being destroyed.
https://pastebin.com/dAukjhMH