diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-22 10:12:02 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-22 13:27:14 +0000 |
commit | 4c66fbe8892e644b3d3c62d5bd94f03831ff76de (patch) | |
tree | 9d6d7765ebe60693d46005ea8d0b5c7a170fc688 | |
parent | 47e50cb3d0088e1080c98996601664119d3d588e (diff) |
Fix QQuickPopupPositioner
tst_tooltip revealed a bug that QQuickPopupPositioner wasn't cleaning
up its ancestor listeners properly. When QQuickPopup was destructed, it
left a listener on the window root item. When the root item got later
destructed, it tried to call a listener (the popup) that was already
deleted.
Change-Id: If041458da24be927f0bad19b9549dcabd1931977
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
-rw-r--r-- | src/templates/qquickpopup.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/templates/qquickpopup.cpp b/src/templates/qquickpopup.cpp index f8df8df0..ef092bed 100644 --- a/src/templates/qquickpopup.cpp +++ b/src/templates/qquickpopup.cpp @@ -458,10 +458,10 @@ void QQuickPopupPositioner::itemParentChanged(QQuickItem *, QQuickItem *parent) addAncestorListeners(parent); } -void QQuickPopupPositioner::itemChildRemoved(QQuickItem *, QQuickItem *child) +void QQuickPopupPositioner::itemChildRemoved(QQuickItem *item, QQuickItem *child) { if (isAncestor(child)) - removeAncestorListeners(child); + removeAncestorListeners(item); } void QQuickPopupPositioner::itemDestroyed(QQuickItem *item) @@ -561,7 +561,7 @@ bool QQuickPopupPositioner::isAncestor(QQuickItem *item) const if (!m_parentItem) return false; - QQuickItem *parent = m_parentItem->parentItem(); + QQuickItem *parent = m_parentItem; while (parent) { if (parent == item) return true; |