hfhbd
12/22/2022, 3:19 PMJNIEnv *env;
JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);
I tried this but always get the error, the env is null:
memScope {
val env = alloc<JNIEnvVar>().ptr
JNI_CreateJavaVM(jvm, env.reinterpret(), vmArgs.ptr)
env.pointed.pointed!!.GetVersion!!(env) // GetVersion!! was null
}
`
So I guess there is an error with converting the env to (void**)
https://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/invocation.html
https://github.com/hfhbd/jniTest/blob/deferWorkaround/src/nativeMain/kotlin/Foo.ktDominaezzz
12/22/2022, 9:51 PMval env = alloc<JNIEnvVar>()
-> val env = alloc<CPointerVar<JNIEnvVar>>()
hfhbd
12/23/2022, 10:50 AMptr
?Dominaezzz
12/23/2022, 10:53 AM