mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-11-13 14:21:18 +01:00
2026-09-27 17:50:19
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
a4fd5c6b0b
commit
d336341c8d
1 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue