From f9297565784e7eae87588417c8080cc1c9eede5f Mon Sep 17 00:00:00 2001 From: Andreas Buhr Date: Thu, 7 Apr 2022 12:18:15 +0200 Subject: [PATCH] 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 Reviewed-by: Jarkko Koivikko Reviewed-by: Assam Boudjelthia --- src/plugins/platforms/android/androidjniaccessibility.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 m_accessibilityContext = nullptr; // This method is called from the Qt main thread, and normally a // QGuiApplication instance will be used as a parent.