MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / GetEnv

Function GetEnv

Source/Wasm/WasmRuntime.cpp:122–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121}
122JNIEnv* GetEnv() {
123 CacheJavaVM();
124 JNIEnv* env = NULL;
125 if (g_VM->GetEnv((void**)&env, JNI_VERSION_1_6) != JNI_OK) {
126 // 当前线程未附加,尝试 attach
127 if (g_VM->AttachCurrentThread(&env, NULL) != 0) {
128 Issue("Failed to attach current thread to JVM");
129 }
130 }
131 return env;
132}
133JNIEXPORT void JNICALL Java_org_ippclub_dorassr_MainActivity_nativeSetMainActivityClass(JNIEnv* env, jclass, jclass cls) {
134 if (g_MainActivityClass) {
135 env->DeleteGlobalRef(g_MainActivityClass);

Callers 8

WaBuildFunction · 0.85
WaFormatFunction · 0.85
WaGitStartCloneFunction · 0.85
WaGitStartPullFunction · 0.85
WaGitRunFunction · 0.85
WaGitPollFunction · 0.85
WaGitCancelFunction · 0.85
WaGitDisposeFunction · 0.85

Calls 1

CacheJavaVMFunction · 0.85

Tested by

no test coverage detected