If I instantiate an object from Kotlin Native insi...
# kotlin-native
l
If I instantiate an object from Kotlin Native inside a Swift function, who deals with the GC when Swift function finishes its scope?
m
You'll have to call
initRuntimeIfNeeded
if you're calling Kotlin from a new thread, which I expect will register the thread as a new GC root and do the "appropriate thing"
l
Thanks. I'll try that.
No luck. I'm calling
initRuntimeIfNeeded
and
GC.collect()
, but objects are still on memory.
We checked if there are any callbacks, but the code seems ok. Any other thing that I should look for?