diff --git a/src/SFML/Window/Android/WindowImplAndroid.cpp b/src/SFML/Window/Android/WindowImplAndroid.cpp index 57a5bed07..5abb1a973 100644 --- a/src/SFML/Window/Android/WindowImplAndroid.cpp +++ b/src/SFML/Window/Android/WindowImplAndroid.cpp @@ -303,6 +303,9 @@ void WindowImplAndroid::processScrollEvent(AInputEvent* _event, ActivityStates* event.mouseWheel.y = AMotionEvent_getY(_event, 0); states->pendingEvents.push_back(event); + + // Dettach this thread from the JVM + lJavaVM->DetachCurrentThread(); } @@ -607,6 +610,9 @@ int WindowImplAndroid::getUnicode(AInputEvent* event) jmethodID MethodGetUnicode = lJNIEnv->GetMethodID(ClassKeyEvent, "getUnicodeChar", "(I)I"); int unicode = lJNIEnv->CallIntMethod(ObjectKeyEvent, MethodGetUnicode, metaState); + // Dettach this thread from the JVM + lJavaVM->DetachCurrentThread(); + return unicode; }