Hi folks. we are seeing some `Attempted to derefer...
# kotlin-native
d
Hi folks. we are seeing some
Attempted to dereference garbage pointer
exceptions in iOS with a few different stack traces, and we are unable to reproduce it. We do a lot of passing objects around between swift and kotlin native, and I don't feel like I have a good handle on how the memory management works in cases where an object originates in kotlin and gets passed into swift, or situations involving lambdas/closures that should be holding on to things. I have a hunch that these issues are related to issues with how we are handling this though. Does anyone know where I can find detailed documentation of how these situations work, or have any info about potential causes of this error when interoping with kotlin native? I have of course read the main kotlin pages like https://kotlinlang.org/docs/native-objc-interop.html.
y
I had the same issue that was caused by passing an object from Kotlin to Swift and then in Swift transferring it between threads
Solved by freezing the object on Kotlin side
d
Interesting, thanks for the tip.