Open swankjesse opened 2 years ago
There’s a function called dealloc
on iOS that can do it. Not sure if/how this is bridged to Kotlin/Native.
https://developer.apple.com/documentation/objectivec/nsobject/1571947-dealloc
Discussed today. Decision is to try to use WeakReference
.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.ref/#:~:text=WeakReference
We’ve already done it for JS and Android: https://github.com/cashapp/zipline/issues/302
For native it’s still a TODO: https://github.com/cashapp/zipline/blob/trunk/zipline/src/nativeMain/kotlin/app/cash/zipline/internal/bridge/leakCanaryNative.kt#L27