Hey :wave: I am trying to implement a simple use c...
# kotlin-native
a
Hey 👋 I am trying to implement a simple use case, have constant defined in K/N and then use it from iOS Swift project (K/N code embedded as a Framework). In short whenever I try to use that constant in anything else than main thread I can see memory leak captured in the Xcode leak instruments.
Copy code
val constant1 = "This leaks"

fun constant2() = "This also leaks"

object Constant3 {
    const val constant3 = "Not better."
}

class Constant4 {
    val constant4 = "Ima leak some more..."
}
and an example of it being used
Copy code
DispatchQueue.global(qos: .background).async {
    let value = ConstantKt.constant1
}
I really hope that I am just using it wrong, any tips?