I have a feeling there may be some potential memory leak with the way Kotlin objects are converted to Obj-C objects. I have a simple class in Kotlin that is the following:
class Agent(
val var1: String,
val var2: String,
val var3: String,
val var4: String,
val var5: String,
val var6: String,
val var7: String,
val var8: Boolean = false,
val var9: String? = null,
val var10: String? = null
)
And simply allocating it in Swift, i.e.,
var agent = Agent(...)
sometimes results in a memory leak. This even happens when
all I do is allocate the object and nothing else references it. The same behavior applies when I put the object declaration in an autoreleasepool.
Below is an image of what Xcode’s debug memory graph shows occasionally when there’s a leak.