diff options
author | David Boddie <david.boddie@nokia.com> | 2010-11-17 12:56:03 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-11-17 12:56:03 (GMT) |
commit | a34730e837bc1430011028dba11bbf5a4672789d (patch) | |
tree | e3a255dc51cada6c680d9110b855f46ba99804bd /src/gui/kernel/qgesturemanager.cpp | |
parent | b5d26bfb348b6a99529ecf9ab66845e7eacd4732 (diff) | |
parent | 88c2e6f8f9f968c6bfe4ca0c0e3e54365a3e0c82 (diff) | |
download | Qt-a34730e837bc1430011028dba11bbf5a4672789d.zip Qt-a34730e837bc1430011028dba11bbf5a4672789d.tar.gz Qt-a34730e837bc1430011028dba11bbf5a4672789d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'src/gui/kernel/qgesturemanager.cpp')
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index 6dd8127..9519447 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -171,9 +171,13 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ foreach (QGesture *g, gestures) { m_deletedRecognizers.remove(g); m_gestureToRecognizer.remove(g); + m_maybeGestures.remove(g); + m_activeGestures.remove(g); + m_gestureOwners.remove(g); + m_gestureTargets.remove(g); + m_gesturesToDelete.insert(g); } - qDeleteAll(gestures); iter = m_objectGestures.erase(iter); } else { ++iter; @@ -381,6 +385,11 @@ bool QGestureManager::filterEventThroughContexts(const QMultiMap<QObject *, recycle(gesture); m_gestureTargets.remove(gesture); } + + //Clean up the Gestures + qDeleteAll(m_gesturesToDelete); + m_gesturesToDelete.clear(); + return ret; } @@ -443,7 +452,8 @@ void QGestureManager::cancelGesturesForChildren(QGesture *original) void QGestureManager::cleanupGesturesForRemovedRecognizer(QGesture *gesture) { QGestureRecognizer *recognizer = m_deletedRecognizers.value(gesture); - Q_ASSERT(recognizer); + if(!recognizer) //The Gesture is removed while in the even loop, so the recognizers for this gestures was removed + return; m_deletedRecognizers.remove(gesture); if (m_deletedRecognizers.keys(recognizer).isEmpty()) { // no more active gestures, cleanup! |