From 67c7a5d176186e37ddd3a3d0f4fbf5047cc896a7 Mon Sep 17 00:00:00 2001 From: Jonathan De Wachter Date: Tue, 11 Mar 2014 21:40:15 +0100 Subject: [PATCH] [Android] Forgot to dettach the SFML thread from the JVM at several places --- src/SFML/Window/Android/WindowImplAndroid.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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; }