Plug memory leak when gestures are grabbed but never triggered

When a gesture is grabbed by QAbstractScrollArea but never triggered
then the deletion of the QAbstractScrollArea would mean that the gesture
created for it would not be deleted.  This ensures that it always
deletes the gestures waiting to be deleted even if no gesture event is
triggered

Task-number: QTBUG-25011

Change-Id: I36118b82baaa60ac4e014896159060e1af76b2d2
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
This commit is contained in:
Andy Shaw 2012-03-28 21:54:52 +02:00 committed by Qt by Nokia
parent 94f7d70a4b
commit 3ec88b355b

View File

@ -285,10 +285,8 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
}
}
}
if (triggeredGestures.isEmpty() && finishedGestures.isEmpty()
&& newMaybeGestures.isEmpty() && notGestures.isEmpty())
return consumeEventHint;
if (!triggeredGestures.isEmpty() || !finishedGestures.isEmpty()
|| !newMaybeGestures.isEmpty() || !notGestures.isEmpty()) {
QSet<QGesture *> startedGestures = triggeredGestures - m_activeGestures;
triggeredGestures &= m_activeGestures;
@ -384,7 +382,7 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *,
recycle(gesture);
m_gestureTargets.remove(gesture);
}
}
//Clean up the Gestures
qDeleteAll(m_gesturesToDelete);
m_gesturesToDelete.clear();