From a416647e385e3d9bd394e960d108bc11d3209d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Str=C3=B8mme?= Date: Wed, 13 May 2015 18:35:36 +0200 Subject: 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 --- src/plugins/platforms/android/androidjnimain.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins/platforms/android') 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(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; } -- cgit v1.2.3