FinalizationRegistry

class FinalizationRegistry<T : JsAny?>(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: JsAny, heldValue: T, unregisterToken: JsAny = definedExternally)

Registers an object with the registry.

Link copied to clipboard
fun unregister(unregisterToken: JsAny)

Unregisters an object from the registry.