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

Skip to content
Commit 5ca09e9d authored by Garfield Tan's avatar Garfield Tan
Browse files

Clear spiedInstance field for spyOn objects.

All spyOn instances are directly returned as the mock, and put in the
mock map with a strong ref in the value of the map. Due to the strong
ref in the value the mock map won't purge that item.

Note this is not a complete solution, for the same reason as its parent
commit. MockCreationListner is registered to a ThreadLocal, so we can
only track mocks created in the same thread where it's registered. That
includes all befores and afters, but we basically lose all mocks created
in test cases because they're run with timeout in a different thread.
They are mostly ActivityRecords.

Bug: 123984854
Test: Smaller memory pressure shown in mem dump.
Change-Id: If3c488a23ab9c59a63d9844fc995e4bb0313896a
parent 26835f0b
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