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>
This commit is contained in:
parent
8fdd1e3867
commit
a416647e38
@ -443,6 +443,11 @@ static void *startMainMethod(void */*data*/)
|
|||||||
if (m_applicationClass)
|
if (m_applicationClass)
|
||||||
QJNIObjectPrivate::callStaticMethod<void>(m_applicationClass, "quitApp", "()V");
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user