diff options
author | Robin Burchell <robin.burchell@jollamobile.com> | 2014-08-06 13:51:19 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@digia.com> | 2014-08-08 06:39:37 +0200 |
commit | c0e47716c402da2333bfa4082c7b40e3b376135c (patch) | |
tree | fa7b329fd1a3296ff1f4c8b10b504a58a0a36725 /src/quick/items/qquickmultipointtoucharea_p.h | |
parent | ca248a5b8edc4341da66d15186770539a7c16ddd (diff) |
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 <erik.verbruggen@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/quick/items/qquickmultipointtoucharea_p.h')
-rw-r--r-- | src/quick/items/qquickmultipointtoucharea_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 <QPointer> #include <QMap> #include <QList> #include <QtGui/qguiapplication.h> @@ -271,7 +272,7 @@ private: QList<QObject*> _movedTouchPoints; int _minimumTouchPoints; int _maximumTouchPoints; - QQuickTouchPoint *_mouseTouchPoint; // exists when mouse button is down and _mouseEnabled is true; null otherwise + QPointer<QQuickTouchPoint> _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; |