Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 93f2744c authored by Chet Haase's avatar Chet Haase
Browse files

Fix activity leak bug

This is a cherry-pick from main branch:
ID: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497

It is possible for ViewRootImpl.doDie() to be called prior to one of the
other calls which tells the system that the window is going to the
foreground. This race condition can cause an activity leak since the
ViewRootImpl in question is stored in a collection of "requestors" which
determine when to pause/resume animators for background/foreground apps.

The fix is two-fold:
- Only cause an item to be added to the "requestor" list in
  AnimationHandler when doDie() has not yet been called (marked by
  the mReoved" flag)
- Store the requestor objects as WeakReferences, rather than the objects
  themselves. Thus if the requestor list is the only referent to the
  object, it can be collected anyway, removing the leak potential.

Bug: 258616235, 258616235
Test: AnimatorLeakTest passes
Change-Id: Icdd6023f6530e3cc4b474f33dc34f6eb7400788e
Merged-in: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497
parent e155f5c7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment