summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/android
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2022-04-07 12:18:15 +0200
committerAndreas Buhr <andreas.buhr@qt.io>2022-04-08 19:55:18 +0200
commitf9297565784e7eae87588417c8080cc1c9eede5f (patch)
tree3d59b3da5928bd20c95464a3387f4986a0bad91a /src/plugins/platforms/android
parent1007aac63a378c1b09f221f9b58b65bb56f9e9e8 (diff)
Fix crash in tst_qmltc_examples on Android
tst_qmltc_examples failed because m_accessibilityContext could become a dangling pointer if the object in points to gets deleted. This resulted in a crash. Amends e0c61193ea8f6462192d2ef7f1d48d8fa3e38c99. Task-number: QTBUG-101865 Task-number: QTBUG-95764 Pick-to: 6.3 6.2 5.15 Change-Id: Ie85118429b1afa6e4a41f899ca065f493e166570 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/plugins/platforms/android')
-rw-r--r--src/plugins/platforms/android/androidjniaccessibility.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/androidjniaccessibility.cpp b/src/plugins/platforms/android/androidjniaccessibility.cpp
index a726d9b2c5..087946ccbf 100644
--- a/src/plugins/platforms/android/androidjniaccessibility.cpp
+++ b/src/plugins/platforms/android/androidjniaccessibility.cpp
@@ -81,7 +81,7 @@ namespace QtAndroidAccessibility
// Because of that almost every method here is split into two parts.
// The _helper part is executed in the context of m_accessibilityContext
// on the main thread. The other part is executed in Java thread.
- static QObject *m_accessibilityContext = nullptr;
+ static QPointer<QObject> m_accessibilityContext = nullptr;
// This method is called from the Qt main thread, and normally a
// QGuiApplication instance will be used as a parent.