loke
02/13/2026, 1:28 PMCLOVIS
02/13/2026, 1:59 PMloke
02/13/2026, 2:24 PMCLOVIS
02/13/2026, 2:25 PMCleaner?loke
02/13/2026, 2:26 PMCLOVIS
02/13/2026, 2:28 PMWeakKeyMap<T, Cleaner> to store all the cleaners until the object they reference has been cleaned?loke
02/13/2026, 2:28 PMclass Foo {
private val value = ...
private val cleaner = createCleaner(value) { obj -> freeObject(obj) }
}
val weakRefToFoo = WeakReference(Foo())