summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-01-04 16:10:03 +0100
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-01-05 06:08:03 +0000
commit60c333cabaf7514790c35f382a9f7f074fb7c20c (patch)
treec4a4918d940ad3132770b386d5fcbb7384f8a3d8 /src/widgets/kernel
parent0cee94017f441be09518a190ac1c4cbd8a76adc6 (diff)
QMacPanGestureRecognizer - stop timer on 'reset'
_panTimer has a target - for example, widget. 'reset' should stop this timer. The problem (quite subtle and difficult to reproduce) found in tst_QTouchEvent: widgets created/destoryed by different tests but we still can have a timer waiting for event dispatcher to 'processEvents', firing with now-invalid dangling pointer - 'target'. Change-Id: Iccaf3368a8ee6a0a2f60e9dcdf5d40fb7392ca21 Task-number: QTBUG-49844 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qmacgesturerecognizer.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qmacgesturerecognizer.cpp b/src/widgets/kernel/qmacgesturerecognizer.cpp
index 47003f5866..9f55e23cee 100644
--- a/src/widgets/kernel/qmacgesturerecognizer.cpp
+++ b/src/widgets/kernel/qmacgesturerecognizer.cpp
@@ -256,6 +256,7 @@ void QMacPanGestureRecognizer::reset(QGesture *gesture)
QPanGesture *g = static_cast<QPanGesture *>(gesture);
_startPos = QPointF();
_panCanceled = true;
+ _panTimer.stop();
g->setOffset(QPointF(0, 0));
g->setLastOffset(QPointF(0, 0));
g->setAcceleration(qreal(1));