summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Buhr <andreas.buhr@qt.io>2022-04-07 12:18:15 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-04-08 17:55:27 +0000
commite77daa1752803ffcb19a5d74cf3aa9666b5f51a4 (patch)
tree4043ff198d3ba20b7972e3eee3af994012b8b75b
parent55d17015c3f1190fb793205c60e1498e6b285534 (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 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> (cherry picked from commit f9297565784e7eae87588417c8080cc1c9eede5f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-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 300dc75f38..c8ba164e13 100644
--- a/src/plugins/platforms/android/androidjniaccessibility.cpp
+++ b/src/plugins/platforms/android/androidjniaccessibility.cpp
@@ -80,7 +80,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.