aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorBartlomiej Moskal <bartlomiej.moskal@siili.com>2020-11-05 10:12:29 +0100
committerBartlomiej Moskal <bartlomiej.moskal@siili.com>2020-11-16 13:17:26 +0000
commit81238e0ff8453f4fb78436ac9bec8452584680ae (patch)
tree62fc758b9cf7692aacdf3ab7a3ea0bb4ed1f586d /src/quick/items
parent4ee1462686dc12eb463f5ba6b378d43a39aed074 (diff)
QQuickWindow: Check if QQuickItem was not deleted
Added check into deliverMatchingPointsToItem method for Android device. In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true It causes delivering touch events to Items which are not interested In some cases it may cause a crash. For example using Material Style in Android. QQuickShaderEffectSource may be deleted and then try to handle touch Fixes: QTBUG-85379 Change-Id: Ia2c4e016db57ef9c86fcc31d4cfba6154068a546 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit a14e4fcdf94d26774490b26a4ef77981594f583f) Reviewed-by: Bartlomiej Moskal <bartlomiej.moskal@siili.com>
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/qquickwindow.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index d0c9ad5454..9ff91eb9a0 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2864,6 +2864,14 @@ void QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
{
Q_Q(QQuickWindow);
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
+#if defined(Q_OS_ANDROID) && QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ // QTBUG-85379
+ // In QT_VERSION below 6.0.0 touchEnabled for QtQuickItems is set by default to true
+ // It causes delivering touch events to Items which are not interested
+ // In some cases (like using Material Style in Android) it may cause a crash
+ if (itemPrivate->wasDeleted)
+ return;
+#endif
pointerEvent->localize(item);
// Let the Item's handlers (if any) have the event first.