summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-08-20 10:53:53 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-11-15 15:03:13 +0000
commitd1b009cbbb06716a6c953184380c84e1cb4fbbf1 (patch)
treee81a8ccbc78b3406d0dccdde75c49cee9ea95666
parent2812f0861c99d9e82a3615a25e272def845b2090 (diff)
Remove the unregistered recognizer from the main list5.12
This amends 1320b2f64412f0d86bd09c66c22df845e13a94a1 to keep the behavior of removing from the main list but without re-introducing the memory leak. Fixes: QTBUG-77770 Change-Id: I91fa6cb71fab8d60baa35417fdb34322af11dbbb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 7d73d4b9a93b3132c1a24aa3ae77f0a307e821fd)
-rw-r--r--src/widgets/kernel/qgesturemanager.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/widgets/kernel/qgesturemanager.cpp b/src/widgets/kernel/qgesturemanager.cpp
index 891858b035..cfa1759dd7 100644
--- a/src/widgets/kernel/qgesturemanager.cpp
+++ b/src/widgets/kernel/qgesturemanager.cpp
@@ -143,6 +143,7 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
{
QList<QGestureRecognizer *> list = m_recognizers.values(type);
+ m_recognizers.remove(type);
foreach (QGesture *g, m_gestureToRecognizer.keys()) {
QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g);
if (list.contains(recognizer)) {