0

As i have googled what i am able to find , i have cached the JavaM pointer in the JNI onload function and then using that javaVM pointer to get the JNI env in the callback function.

It is working fine until the pointer reference is not getting changed for JavaVM?

  • Possible duplicate of [JNI Attach/Detach thread memory management](https://stackoverflow.com/questions/9642506/jni-attach-detach-thread-memory-management) – Andrew Henle Oct 11 '18 at 12:47
  • I'm not sure I understand exactly what you're asking. But if your question is how to ensure that you have a valid `JNIEnv*` on any thread, see https://stackoverflow.com/questions/30026030/what-is-the-best-way-to-save-jnienv/30026231#30026231 – Michael Oct 11 '18 at 13:37

0 Answers0