2026-09-27 17:50:19

Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
lizzie
2026-09-27 17:50:19 +00:00
parent a4fd5c6b0b
commit d336341c8d
+3 -3
View File
@@ -107,14 +107,14 @@ namespace Common::Android {
JNIEnv *GetEnvForThread() { JNIEnv *GetEnvForThread() {
thread_local static struct OwnedEnv { thread_local static struct OwnedEnv {
OwnedEnv() { OwnedEnv() {
status = s_java_vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6); status = state.java_vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6);
if (status == JNI_EDETACHED) if (status == JNI_EDETACHED)
s_java_vm->AttachCurrentThread(&env, nullptr); state.java_vm->AttachCurrentThread(&env, nullptr);
} }
~OwnedEnv() { ~OwnedEnv() {
if (status == JNI_EDETACHED) if (status == JNI_EDETACHED)
s_java_vm->DetachCurrentThread(); state.java_vm->DetachCurrentThread();
} }
int status; int status;