From 033318f7a747ee2630542bed37df7e3fc10a0fb1 Mon Sep 17 00:00:00 2001 From: Jason Haslam Date: Fri, 21 Nov 2014 14:33:59 -0700 Subject: Check for valid receiver before sending gesture events. Gesture events sent to a disappearing tooltip can crash. This can most easily be seen by scrolling over a tooltip on OSX with a magic mouse middle scroll gesture. Task-number: QTBUG-42826 Change-Id: Id5510895f63297ca157e3d24a3f4e3a6034586e8 Reviewed-by: Andy Shaw Reviewed-by: Shawn Rutledge Reviewed-by: Laszlo Agocs --- src/gui/kernel/qguiapplication.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index e3f4794e6d..dc5501eaf5 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -2168,6 +2168,9 @@ void QGuiApplicationPrivate::processTabletLeaveProximityEvent(QWindowSystemInter #ifndef QT_NO_GESTURES void QGuiApplicationPrivate::processGestureEvent(QWindowSystemInterfacePrivate::GestureEvent *e) { + if (e->window.isNull()) + return; + QNativeGestureEvent ev(e->type, e->pos, e->pos, e->globalPos, e->realValue, e->sequenceId, e->intValue); ev.setTimestamp(e->timestamp); QGuiApplication::sendSpontaneousEvent(e->window, &ev); -- cgit v1.2.3