register

open fun register(@NonNull obj: Any, @NonNull nativeCleaner: Runnable)

Register object whose life cycle is tracked to perform cleanup action

Parameters

obj

Java object to track

nativeCleaner

callback method to clean the native peer when the Java object is garbage collected