Remove from hover list on destruction
authorAlan Alpert <aalpert@blackberry.com>
Wed, 1 May 2013 23:36:02 +0000 (16:36 -0700)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 3 May 2013 11:02:31 +0000 (13:02 +0200)
When hoverEnabled is unset the item remains in a hovered state until the
mouse leaves. In this circumstance, the item could be destroyed without
cleaning up the reference in the hovered items list.

To catch this and similar circumstances, the item is removed from the
list when destroyed, regardless of hoverEnabled status.

Task-number: QTBUG-30962
Change-Id: I982ab8c9e1077fecc885fd166d70bbbbbe8fc179
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Liang Qi <liang.qi@digia.com>
src/quick/items/qquickitem.cpp

index 111e74e..733e26a 100644 (file)
@@ -2506,8 +2506,7 @@ void QQuickItemPrivate::derefWindow()
     if (c->cursorItem == q)
         c->cursorItem = 0;
 #endif
-    if ( hoverEnabled )
-        c->hoverItems.removeAll(q);
+    c->hoverItems.removeAll(q);
     if (itemNodeInstance)
         c->cleanup(itemNodeInstance);
     if (!parentItem)