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

Skip to content
Commit 4873e34e authored by Chet Haase's avatar Chet Haase
Browse files

Fix activity leak bug

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: I7dfebac90aa43f89433f49e0ed60b3ff57bcc497
parent 814729fe
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