From 1ab60b0430f2b57418ee4954fcfa43e1e14766fc Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Tue, 13 Dec 2016 10:02:15 +0200 Subject: Make sure we quit qt when the service is destroyed Task-number: QTBUG-58471 Change-Id: I37f162717f57323136811a8f80d53e3c3b7d6f22 Reviewed-by: Christian Stromme --- src/plugins/platforms/android/androidjnimain.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/plugins/platforms/android/androidjnimain.cpp') diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp index 0fabb25233..17c197ea38 100644 --- a/src/plugins/platforms/android/androidjnimain.cpp +++ b/src/plugins/platforms/android/androidjnimain.cpp @@ -533,6 +533,12 @@ static jboolean startQtApplication(JNIEnv *env, jobject /*object*/, jstring para return pthread_create(&m_qtAppThread, nullptr, startMainMethod, nullptr) == 0; } +static void quitQtCoreApplication(JNIEnv *env, jclass /*clazz*/) +{ + Q_UNUSED(env); + QCoreApplication::quit(); +} + static void quitQtAndroidPlugin(JNIEnv *env, jclass /*clazz*/) { Q_UNUSED(env); @@ -733,6 +739,7 @@ static JNINativeMethod methods[] = { {"startQtAndroidPlugin", "()Z", (void *)startQtAndroidPlugin}, {"startQtApplication", "(Ljava/lang/String;Ljava/lang/String;)V", (void *)startQtApplication}, {"quitQtAndroidPlugin", "()V", (void *)quitQtAndroidPlugin}, + {"quitQtCoreApplication", "()V", (void *)quitQtCoreApplication}, {"terminateQt", "()V", (void *)terminateQt}, {"setDisplayMetrics", "(IIIIDDDD)V", (void *)setDisplayMetrics}, {"setSurface", "(ILjava/lang/Object;II)V", (void *)setSurface}, -- cgit v1.2.1