You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(android): prevent memory leak from reused CustomTransition animator (#11270)
CustomTransition exposed a single shared AnimatorSet (this.animatorSet)
and returned it from onAppear/onDisappear. androidx clones the transition
per run but shares this field, and the framework attaches its own end
listeners (Visibility$OverlayListener, etc.) to the returned AnimatorSet.
For zero-duration ("none") navigation those listeners are not removed, so
a reused CustomTransition accumulated one stale listener per navigation,
each retaining the previous fragment and its page view. With animations
disabled this leaked the entire navigation history; the leaked Java views
in turn kept their linked JS objects alive forever.
Run on a per-invocation clone of the AnimatorSet so framework listeners
land on a throwaway instance and the shared template stays clean, and
release the animated view (mView) when the animation ends.
[skip ci]
0 commit comments