MCPcopy Create free account
hub / github.com/Tencent/tgfx / SetJavaVM

Method SetJavaVM

src/platform/android/JNIEnvironment.cpp:41–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41bool JNIEnvironment::SetJavaVM(JavaVM* javaVM) {
42 if (globalJavaVM == javaVM) {
43 return true;
44 }
45 if (globalJavaVM != nullptr && javaVM != nullptr && globalJavaVM != javaVM) {
46 return false;
47 }
48 globalJavaVM = javaVM;
49 if (globalJavaVM != nullptr) {
50 pthread_key_create(&envKey, JNI_Thread_Destroy);
51 JNIInit::Run();
52 } else {
53 pthread_key_delete(envKey);
54 }
55 return true;
56}
57
58JNIEnv* JNIEnvironment::Current() {
59 JavaVM* javaVM = globalJavaVM;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected