Are there any plans to add destructors to kotlin n...
# kotlin-native
b
Are there any plans to add destructors to kotlin native at least? It would make developing mpp libraries that use cinterops on the native side that much easier...
n
Considering that Kotlin Native will be using some sort of GC in the future ( https://blog.jetbrains.com/kotlin/2020/07/kotlin-native-memory-management-roadmap/ ) adding in destructors wouldn't make sense. GC isn't deterministic like Reference Counting.
b
I wouldn't expect it to manage memory of cinterops allocations, therefore destructors would be very helpful in cleaning up those external memory allocations when a wrapper kotlin object is destroyed