jmullin
01/21/2020, 4:00 PMsomePointer.rawValue
corrects the issue. I’m not using the value, just putting that line as a statement. Are there some side-effects anyone is aware of to calling .rawValue
on a pointer (implemented as a getter of value.toNativePtr()
internally) that might explain what I’m seeing? I have a number of other things to debug into, but seeing this leads me to believe there’s more going on here that I need to understand first.kpgalligan
01/21/2020, 4:05 PMjmullin
01/21/2020, 4:26 PMjmullin
01/21/2020, 4:32 PM.rawValue
call I alluded to above is in the implementation for another method which the JVM class calls via JNI on that side. It’s actually just a debug print message method used on both ends. I noticed that when I remove the call from the Kotlin/JVM source, this NPE situation happens. Introducing the call, even when the K/N implementation does nothing but take the jstring
pointer and call .rawValue
, causes everything to work properly. So something’s behaving strangely; I’m still hunting down stuff in the JNI bits I’m using, as I suspect it will end up being a GlobalRef vs LocalRef situation where the JVM has moved things out from under me. We’ll see.jmullin
01/21/2020, 8:08 PM.rawValue
in K/N was fixing/masking the issues, but I at least have a path forward.