diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-17 16:45:26 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-08-17 16:45:26 (GMT) |
commit | b53107577d64f4a3694a2184a3ccc87ed3aed3f2 (patch) | |
tree | 316693f7b2e59a8ae2036e517e1c53fe83ef1bdd | |
parent | 87e9034caf90fb02ae2564947b9cbf464b3ca97c (diff) | |
parent | 81644d683c0c8da3f14f162e31bc55038cb121d7 (diff) | |
download | Qt-b53107577d64f4a3694a2184a3ccc87ed3aed3f2.zip Qt-b53107577d64f4a3694a2184a3ccc87ed3aed3f2.tar.gz Qt-b53107577d64f4a3694a2184a3ccc87ed3aed3f2.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-s60-public:
Fix memory leak in gesture manager
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index fe9dd8a..e768a21 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -129,7 +129,12 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type) { QList<QGestureRecognizer *> list = m_recognizers.values(type); - m_recognizers.remove(type); + while (QGestureRecognizer *recognizer = m_recognizers.take(type)) { + if (!m_obsoleteGestures.contains(recognizer)) { + // inserting even an empty QSet will cause the recognizer to be deleted on destruction of the manager + m_obsoleteGestures.insert(recognizer, QSet<QGesture *>()); + } + } foreach (QGesture *g, m_gestureToRecognizer.keys()) { QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g); if (list.contains(recognizer)) { |