Reference Queue Retained Object Tracker
ReferenceQueueRetainedObjectTracker can be passed objects to expectDeletionOnTriggerFor. It will create KeyedWeakReference instances that reference tracked objects, and check if those references have been cleared as expected. If not, these objects are considered retained and ReferenceQueueRetainedObjectTracker will then notify registered OnObjectRetainedListeners. ReferenceQueueRetainedObjectTracker is thread safe.
Functions
Clears all KeyedWeakReference
Clears weak reachability expectations for objects that were created before uptime.
Start tracking the provided target object, with the expectation that it should be eligible for automatic garbage collection soon, i.e. that it should not be strongly reachable by the time RetainTrigger.markRetainedIfStronglyReachable is called on the returned RetainTrigger.
Properties
Returns true if any of the tracked objects are currently retained.
Returns true if there are any tracked objects that aren't currently weakly reachable.
Returns the number of retained objects.
Subset of trackedWeakReferences that have been marked as retained.
Returns the number of tracked objects that aren't weakly reachable.
List of KeyedWeakReference that have not been enqueued in the reference queue yet, which means their referent is most likely still strongly reachable.