summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBogDan Vatra <bogdan@kdab.com>2016-12-13 10:02:15 +0200
committerBogDan Vatra <bogdan@kdab.com>2017-03-27 12:20:40 +0000
commit1ab60b0430f2b57418ee4954fcfa43e1e14766fc (patch)
treedb70d956405f13078700fbb08350ba1cd55fcc23 /src
parent41750492db58ca30a70a685cd6a4ee180c0b4959 (diff)
downloadqtbase-1ab60b0430f2b57418ee4954fcfa43e1e14766fc.tar.gz
Make sure we quit qt when the service is destroyed
Task-number: QTBUG-58471 Change-Id: I37f162717f57323136811a8f80d53e3c3b7d6f22 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java1
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java2
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp7
3 files changed, 9 insertions, 1 deletions
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
index b7d1217e98..710648e25a 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java
@@ -348,6 +348,7 @@ public class QtNative
// application methods
public static native void startQtApplication(String params, String env);
public static native boolean startQtAndroidPlugin();
+ public static native void quitQtCoreApplication();
public static native void quitQtAndroidPlugin();
public static native void terminateQt();
// application methods
diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
index 5ac406c710..035a65a84c 100644
--- a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java
@@ -185,6 +185,6 @@ public class QtServiceDelegate
public void onDestroy()
{
- QtNative.setService(null, null);
+ QtNative.quitQtCoreApplication();
}
}
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},