From c0e47716c402da2333bfa4082c7b40e3b376135c Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Wed, 6 Aug 2014 13:51:19 +0200 Subject: MultiPointTouchArea: Guard _mouseTouchPoint with a QPointer. The touch point can be deleted (for instance, on ungrab()) without _mouseTouchPoint being reset occurs. This caused a crash on tst_qquickmultipointtoucharea::inFlickable with MallocScribble=1 enabled on OS X (use-after-free). Change-Id: Ife9f59d75827285b18bb1772ddbee30d79a3f0b5 Reviewed-by: Erik Verbruggen Reviewed-by: Shawn Rutledge --- src/quick/items/qquickmultipointtoucharea_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick/items/qquickmultipointtoucharea_p.h') diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index 9dbca2be54..a6bb6ba81d 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -45,6 +45,7 @@ #include "qquickitem.h" #include "qevent.h" +#include #include #include #include @@ -271,7 +272,7 @@ private: QList _movedTouchPoints; int _minimumTouchPoints; int _maximumTouchPoints; - QQuickTouchPoint *_mouseTouchPoint; // exists when mouse button is down and _mouseEnabled is true; null otherwise + QPointer _mouseTouchPoint; // exists when mouse button is down and _mouseEnabled is true; null otherwise QTouchEvent::TouchPoint _mouseQpaTouchPoint; // synthetic QPA touch point to hold state and position of the mouse QPointF _mousePos; bool _stealMouse; -- cgit v1.2.3