diff options
author | Dominik Holland <dominik.holland@nokia.com> | 2010-09-07 08:31:41 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2010-09-07 08:33:51 (GMT) |
commit | 201e4927f9e23150f460e711a2859dbff3e1353c (patch) | |
tree | fd58d1c1a92eb49ee866a933b7a7c54ac25d7c55 /src/gui/kernel/qgesturemanager.cpp | |
parent | 854a274d7b17277235acc1fb3c36f576c7c6b8ec (diff) | |
download | Qt-201e4927f9e23150f460e711a2859dbff3e1353c.zip Qt-201e4927f9e23150f460e711a2859dbff3e1353c.tar.gz Qt-201e4927f9e23150f460e711a2859dbff3e1353c.tar.bz2 |
Replaced QWeakPointer to *Pointer in QGestureManager.
The QWeakPointer was part of a key in a QMap. When the QWeakPointer gets deleted,
the key changes and the sorting of the Map was wrong. That leads to an random crash.
It should be safe not to use QWeakPointer as we remove pointers from the
objectGestures map when a widget or graphicsitem gets destroyed.
Reviewed-by: Denis Dzyubenko
Diffstat (limited to 'src/gui/kernel/qgesturemanager.cpp')
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index cb4061e..5c80340 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -162,7 +162,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ QMap<ObjectGesture, QList<QGesture *> >::Iterator iter = m_objectGestures.begin(); while (iter != m_objectGestures.end()) { ObjectGesture objectGesture = iter.key(); - if (objectGesture.gesture == type && target == objectGesture.object.data()) { + if (objectGesture.gesture == type && target == objectGesture.object) { QSet<QGesture *> gestures = iter.value().toSet(); for (QHash<QGestureRecognizer *, QSet<QGesture *> >::iterator it = m_obsoleteGestures.begin(), e = m_obsoleteGestures.end(); it != e; ++it) { @@ -172,6 +172,7 @@ void QGestureManager::cleanupCachedGestures(QObject *target, Qt::GestureType typ m_deletedRecognizers.remove(g); m_gestureToRecognizer.remove(g); } + qDeleteAll(gestures); iter = m_objectGestures.erase(iter); } else { |