FinalizationRegistry

external class FinalizationRegistry<T>(cleanupCallback: (heldValue: T) -> Unit)(source)

Parameters

cleanupCallback

The callback to call after an object in the registry has been reclaimed.

Constructors

Link copied to clipboard
constructor(cleanupCallback: (heldValue: T) -> Unit)

Creates a finalization registry with an associated cleanup callback

Functions

Link copied to clipboard
fun register(target: Any, heldValue: T, unregisterToken: Any = definedExternally)

Registers an object with the registry.

Link copied to clipboard
fun unregister(unregisterToken: Any)

Unregisters an object from the registry.