QQuickWindow: Replace assert() on unreleased touch points by warning.
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Tue, 5 May 2015 07:36:31 +0000 (09:36 +0200)
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Wed, 6 May 2015 08:11:11 +0000 (08:11 +0000)
Output a warning message and clear
QQuickWindowPrivate::itemForTouchPointId should unreleased touch points
exist when QEvent::TouchEnd is received.

Task-number: QTBUG-45856
Change-Id: I8a05220e4258c0ca401f79a2c32ec4f1d43fa444
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
src/quick/items/qquickwindow.cpp

index bccebb1..0b1c795 100644 (file)
@@ -1989,7 +1989,12 @@ void QQuickWindowPrivate::reallyDeliverTouchEvent(QTouchEvent *event)
     }
 
     if (event->type() == QEvent::TouchEnd) {
-        Q_ASSERT(itemForTouchPointId.isEmpty());
+        if (!itemForTouchPointId.isEmpty()) {
+            qWarning() << "No release received for" << itemForTouchPointId.size()
+                << "touch points over" << itemForTouchPointId.begin().value()
+                << "on touch end.";
+            itemForTouchPointId.clear();
+        }
     }
 
     --touchRecursionGuard;