Infinite ObjectAnimators caused Drawable leaks

Drawable has an `mCallback` field that is a weak ref to the callback view. It's a weak ref as an attempt to prevent leaks ([change](https://cs.android.com/android/_/android/platform/frameworks/base/+/f2a47782f31b58d2d31bd00b50fe43604af8b9c2)). Unfortunately, when an object animator runs a drawable forever, the `mCallback` weak ref will be checked every frame and the callback reference held as a java local for a brief moment, which makes it really hard for the GC to collect the targeted object.

Fixes #2116
3 files changed
tree: f7b1b34315abbef6a953aea63a0980e61ed4ca73
  1. .github/
  2. docs/
  3. gradle/
  4. hooks/
  5. leakcanary-android/
  6. leakcanary-android-core/
  7. leakcanary-android-instrumentation/
  8. leakcanary-android-process/
  9. leakcanary-android-release/
  10. leakcanary-android-sample/
  11. leakcanary-android-startup/
  12. leakcanary-android-utils/
  13. leakcanary-deobfuscation-gradle-plugin/
  14. leakcanary-object-watcher/
  15. leakcanary-object-watcher-android/
  16. leakcanary-object-watcher-android-androidx/
  17. leakcanary-object-watcher-android-core/
  18. leakcanary-object-watcher-android-startup/
  19. leakcanary-object-watcher-android-support-fragments/
  20. plumber-android/
  21. plumber-android-core/
  22. plumber-android-startup/
  23. shark/
  24. shark-android/
  25. shark-cli/
  26. shark-graph/
  27. shark-hprof/
  28. shark-hprof-test/
  29. shark-log/
  30. shark-test/
  31. tmp/
  32. .editorconfig
  33. .gitattributes
  34. .gitignore
  35. build.gradle
  36. detekt-config.yml
  37. gradle.properties
  38. gradlew
  39. LICENSE.txt
  40. mkdocs.yml
  41. README.md
  42. settings.gradle
  43. shark-cli.sh
README.md

LeakCanary 🐤

A memory leak detection library for Android.

square.github.io/leakcanary

🙏 If you like LeakCanary you can show support by starring ⭐ this repository.

License

Copyright 2015 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.