summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-02 01:00:07 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-02 01:00:08 +0100
commit607338f98feaa2561340c7ff4249d470b36d0503 (patch)
treeaec623c5af7ec8a6e2f0ac530425ee98a720772c /src/plugins
parentf58e47c2f34c6a703115c9b4486040ba12bd97e9 (diff)
parentf5850cb0da5d9b610711d4fd3c1eaded9d6414e1 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/android/androidjnimain.cpp16
-rw-r--r--src/plugins/platforms/android/qandroidplatformopenglwindow.cpp3
2 files changed, 11 insertions, 8 deletions
diff --git a/src/plugins/platforms/android/androidjnimain.cpp b/src/plugins/platforms/android/androidjnimain.cpp
index 37cfbc13ec..6ae429b24e 100644
--- a/src/plugins/platforms/android/androidjnimain.cpp
+++ b/src/plugins/platforms/android/androidjnimain.cpp
@@ -565,10 +565,15 @@ static void quitQtAndroidPlugin(JNIEnv *env, jclass /*clazz*/)
static void terminateQt(JNIEnv *env, jclass /*clazz*/)
{
// QAndroidEventDispatcherStopper is stopped when the user uses the task manager to kill the application
- if (!QAndroidEventDispatcherStopper::instance()->stopped()) {
- sem_wait(&m_terminateSemaphore);
- sem_destroy(&m_terminateSemaphore);
+ if (QAndroidEventDispatcherStopper::instance()->stopped()) {
+ QAndroidEventDispatcherStopper::instance()->startAll();
+ QCoreApplication::quit();
+ QAndroidEventDispatcherStopper::instance()->goingToStop(false);
}
+
+ sem_wait(&m_terminateSemaphore);
+ sem_destroy(&m_terminateSemaphore);
+
env->DeleteGlobalRef(m_applicationClass);
env->DeleteGlobalRef(m_classLoaderObject);
if (m_resourcesObj)
@@ -588,10 +593,7 @@ static void terminateQt(JNIEnv *env, jclass /*clazz*/)
m_androidPlatformIntegration = nullptr;
delete m_androidAssetsFileEngineHandler;
m_androidAssetsFileEngineHandler = nullptr;
-
- if (!QAndroidEventDispatcherStopper::instance()->stopped()) {
- sem_post(&m_exitSemaphore);
- }
+ sem_post(&m_exitSemaphore);
}
static void setSurface(JNIEnv *env, jobject /*thiz*/, jint id, jobject jSurface, jint w, jint h)
diff --git a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
index 3e1cfe305d..3de5d30623 100644
--- a/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
+++ b/src/plugins/platforms/android/qandroidplatformopenglwindow.cpp
@@ -47,6 +47,7 @@
#include <QSurfaceFormat>
#include <QtGui/private/qwindow_p.h>
+#include <QtGui/qguiapplication.h>
#include <qpa/qwindowsysteminterface.h>
#include <qpa/qplatformscreen.h>
@@ -121,7 +122,7 @@ void QAndroidPlatformOpenGLWindow::setGeometry(const QRect &rect)
EGLSurface QAndroidPlatformOpenGLWindow::eglSurface(EGLConfig config)
{
- if (QAndroidEventDispatcherStopper::stopped())
+ if (QAndroidEventDispatcherStopper::stopped() || QGuiApplication::applicationState() == Qt::ApplicationSuspended)
return m_eglSurface;
QMutexLocker lock(&m_surfaceMutex);