AregevDev
04/12/2019, 8:29 AMmsink
04/12/2019, 8:42 AMthis.str = str.ptr
AregevDev
04/12/2019, 8:56 AMptr
AregevDev
04/12/2019, 9:22 AMval str = "Hello".cstr.getPointer(ArenaBase())
val value = cValue<testlib> {
a = 12
this.str = str
}
Managed to solve it this way, not sure it's the best practicemsink
04/12/2019, 9:31 AMmemScoped { }
svyatoslav.scherbina
04/12/2019, 9:46 AMnot sure it’s the best practice (edited)You have memory leak here, because you allocate a C string in an arena which doesn’t ever get disposed.