Will the Objective-C reference-counting be integra...
# kotlin-native
t
Will the Objective-C reference-counting be integrated with the Kotlin/Native reference-counting somehow? (Perhaps via the recently added finalizer support?)
s
Objective-C reference counting is already integrated. When the Kotlin wrapper is created, the Objective-C object is retained. When wrapper gets deallocated, the Objective-C object is released.
t
Ah, neat! Is this feature built-in to the compiler, or could I do the same thing in my Kotlin code (i.e., release native objects when Kotlin wrapper objects are deallocated) if I'm wrapping e.g. Python or COM objects?
s
Currently the feature is built-in to the compiler and implemented only for Objective-C wrappers, but if necessary it can be generalized and exposed to Kotlin code later.