From abc60b14620253f61b0c0f1dff1ca0935b18761c Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 29 Aug 2017 13:20:45 +0200 Subject: Fix a crash with ScrollView + TextArea TextArea was not cleaning up its geometry change listener on the Flickable it was attached to. Task-number: QTBUG-62292 Change-Id: I31223d4fcf0b46235b18e8eb05bab686a32f5481 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquicktextarea.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquicktextarea.cpp') diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index 4a171603..afc2932c 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -256,7 +256,7 @@ void QQuickTextAreaPrivate::detachFlickable() QObject::disconnect(flickable, &QQuickFlickable::contentXChanged, q, &QQuickItem::update); QObject::disconnect(flickable, &QQuickFlickable::contentYChanged, q, &QQuickItem::update); - QQuickItemPrivate::get(flickable)->updateOrRemoveGeometryChangeListener(this, QQuickGeometryChange::Size); + QQuickItemPrivate::get(flickable)->updateOrRemoveGeometryChangeListener(this, QQuickGeometryChange::Nothing); QObjectPrivate::disconnect(flickable, &QQuickFlickable::contentWidthChanged, this, &QQuickTextAreaPrivate::resizeFlickableControl); QObjectPrivate::disconnect(flickable, &QQuickFlickable::contentHeightChanged, this, &QQuickTextAreaPrivate::resizeFlickableControl); @@ -406,6 +406,13 @@ QQuickTextArea::QQuickTextArea(QQuickItem *parent) d, &QQuickTextAreaPrivate::readOnlyChanged); } +QQuickTextArea::~QQuickTextArea() +{ + Q_D(QQuickTextArea); + if (d->flickable) + d->detachFlickable(); +} + QQuickTextAreaAttached *QQuickTextArea::qmlAttachedProperties(QObject *object) { return new QQuickTextAreaAttached(object); -- cgit v1.2.3