summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@theqtcompany.com>2015-05-13 18:35:36 +0200
committerChristian Stromme <christian.stromme@theqtcompany.com>2015-08-03 14:55:26 +0000
commita416647e385e3d9bd394e960d108bc11d3209d5b (patch)
treeddd3a2f9093c070f4bd367e7430dc8ffb2c03dde /src/plugins/platforms/android
parent8fdd1e3867019fc62ee2bba3c8a892d8e701f8ed (diff)
Android: Manually detach the thread after calling quitApp.
On Android 5.0 ART will complain when we don't detach the thread before the application is about to quit (non-fatal). This is because we re-attach to call quitApp and then leave it attached. Change-Id: I4571ef5f38d92afcaf91cb920ebe121a7be7835a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index cf81f92e47..a04bf1eccb 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -443,6 +443,11 @@ static void *startMainMethod(void */*data*/)
if (m_applicationClass)
QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "quitApp", "()V");
+ // All attached threads should be detached before returning from this function.
+ JavaVM *vm = QtAndroidPrivate::javaVM();
+ if (vm != 0)
+ vm->DetachCurrentThread();
+
return 0;
}