Yan Pujante
08/09/2019, 3:18 PMlibnative_kref_example_Clazz newInstance = lib->kotlin.root.example.Clazz.Clazz();
long x = lib->kotlin.root.example.Clazz.memberFunction(newInstance, 42);
lib->DisposeStablePointer(newInstance.pinned);
What happens if instead I have the following Kotlin code:
interface Foo {}
private class FooImpl : Foo {}
createFoo() : Foo { return FooImpl() }
and I call createFoo
from C++ (in other words, the object is created on the Kotlin side not the C++ side). How do I tell the Kotlin side that I am going to keep the Foo
instance for a while? Does it work the same and I am supposed to call DisposeStablePointer
when I am done?svyatoslav.scherbina
08/09/2019, 4:28 PMDoes it work the same and I am supposed to callYes.when I am done?DisposeStablePointer