From 5ab2b8b95156f74210f9d6cc49a62f9e3a82c9ec Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Wed, 22 Nov 2023 14:56:36 +0200 Subject: [PATCH] Android: don't directly access m_qtThread member Task-number: QTBUG-118077 Change-Id: I2103483a2bfa8abe9be832790611b07a5d011f76 Reviewed-by: Ville Voutilainen --- .../jar/src/org/qtproject/qt/android/QtActivityBase.java | 2 +- .../jar/src/org/qtproject/qt/android/QtApplicationBase.java | 2 +- src/android/jar/src/org/qtproject/qt/android/QtNative.java | 2 +- src/android/jar/src/org/qtproject/qt/android/QtServiceBase.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt/android/QtActivityBase.java b/src/android/jar/src/org/qtproject/qt/android/QtActivityBase.java index d51b568c25..764f1344e3 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtActivityBase.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtActivityBase.java @@ -147,7 +147,7 @@ public class QtActivityBase extends Activity if (!m_retainNonConfigurationInstance) { QtNative.terminateQt(); QtNative.setActivity(null); - QtNative.m_qtThread.exit(); + QtNative.getQtThread().exit(); System.exit(0); } } diff --git a/src/android/jar/src/org/qtproject/qt/android/QtApplicationBase.java b/src/android/jar/src/org/qtproject/qt/android/QtApplicationBase.java index 723da0abe0..aca0b2da0d 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtApplicationBase.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtApplicationBase.java @@ -9,7 +9,7 @@ public class QtApplicationBase extends Application { @Override public void onTerminate() { QtNative.terminateQt(); - QtNative.m_qtThread.exit(); + QtNative.getQtThread().exit(); super.onTerminate(); } } diff --git a/src/android/jar/src/org/qtproject/qt/android/QtNative.java b/src/android/jar/src/org/qtproject/qt/android/QtNative.java index 6cec72376a..1f9b74add4 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtNative.java @@ -42,7 +42,7 @@ public class QtNative private static final ArrayList m_lostActions = new ArrayList<>(); private static boolean m_started = false; - public static QtThread m_qtThread = new QtThread(); + private static final QtThread m_qtThread = new QtThread(); private static ClassLoader m_classLoader = null; private static final Runnable runPendingCppRunnablesRunnable = new Runnable() { diff --git a/src/android/jar/src/org/qtproject/qt/android/QtServiceBase.java b/src/android/jar/src/org/qtproject/qt/android/QtServiceBase.java index 51eba48e6b..3f2a82fd5e 100644 --- a/src/android/jar/src/org/qtproject/qt/android/QtServiceBase.java +++ b/src/android/jar/src/org/qtproject/qt/android/QtServiceBase.java @@ -35,7 +35,7 @@ public class QtServiceBase extends Service { QtNative.quitQtCoreApplication(); QtNative.terminateQt(); QtNative.setService(null); - QtNative.m_qtThread.exit(); + QtNative.getQtThread().exit(); System.exit(0); }