summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2016-09-13 12:42:12 +0200
committerMitch Curtis <mitch.curtis@qt.io>2016-09-15 13:20:42 +0000
commit5149aa68eca6ede8836ec4f07a14d22d9da9b161 (patch)
tree3e3595842ac5c31f26fc5723ada8d079ae7ecc54 /src
parenta3da23d5a92ab0f9b8280b9ed591986f8ac6a2d6 (diff)
Fix crash on exit when using default property aliases with layouts
The layout was being destroyed before the text, which meant that the removeItemChangeListener() call never got hit. To ensure that the listener is always removed, loop through each child in QQuickLayout's destructor. This is a manual cherry-pick of 59c6c0e0b1b5b46747595a58e11311b7393d7e70. Task-number: QTBUG-51927 Change-Id: I669f42beb8c3dd6b4b741cae0b16e017bb3409df Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/layouts/qquicklayout.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/imports/layouts/qquicklayout.cpp b/src/imports/layouts/qquicklayout.cpp
index abc8f97cec..99148265bb 100644
--- a/src/imports/layouts/qquicklayout.cpp
+++ b/src/imports/layouts/qquicklayout.cpp
@@ -698,6 +698,10 @@ QQuickLayout::QQuickLayout(QQuickLayoutPrivate &dd, QQuickItem *parent)
QQuickLayout::~QQuickLayout()
{
d_func()->m_isReady = false;
+
+ const auto childItems = d_func()->childItems;
+ for (QQuickItem *child : childItems)
+ QQuickItemPrivate::get(child)->removeItemChangeListener(this, QQuickItemPrivate::SiblingOrder);
}
QQuickLayoutAttached *QQuickLayout::qmlAttachedProperties(QObject *object)