• Sceneform SDK for Android was open sourced and archived (github.com/google-ar/sceneform-android-sdk) with version 1.16.0.
  • This site (developers.google.com/sceneform) serves as the documentation archive for the previous version, Sceneform SDK for Android 1.15.0.
  • Do not use version 1.17.0 of the Sceneform Maven artifacts.
  • The 1.17.1 Maven artifacts can be used. Other than the version, however, the 1.17.1 artifacts are identical to the 1.15.0 artifacts.

CleanupRegistry

public class CleanupRegistry

Maintains a ReferenceQueue and executes a Runnable after each object in the queue is garbage collected.

Public Constructors

CleanupRegistry(HashSet<CleanupItem<T>> cleanupItemHashSet, ReferenceQueue<T> referenceQueue)

Public Methods

void
destroyAllResources()
Ignores reference count and releases any associated resources
long
reclaimReleasedResources()
Polls the ReferenceQueue for garbage collected objects and runs the associated Runnable
void
register(T trackedObject, Runnable cleanupCallback)
Adds trackedOBject to the ReferenceQueue.

Inherited Methods

Public Constructors

public CleanupRegistry ()

public CleanupRegistry (HashSet<CleanupItem<T>> cleanupItemHashSet, ReferenceQueue<T> referenceQueue)

Parameters
cleanupItemHashSet
referenceQueue

Public Methods

public void destroyAllResources ()

Ignores reference count and releases any associated resources

public long reclaimReleasedResources ()

Polls the ReferenceQueue for garbage collected objects and runs the associated Runnable

Returns
  • count of resources remaining.

public void register (T trackedObject, Runnable cleanupCallback)

Adds trackedOBject to the ReferenceQueue.

Parameters
trackedObject The target to be tracked.
cleanupCallback Will be called after trackedOBject is disposed.