From 60d798f2a445552165fae3e622129f5356f61a0b Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 10 Sep 2020 14:35:00 +0200 Subject: Unregister the accessible observer before deleting the private object By unregistering it in the destructor of the control and not the private object ensures that it does not react to any accessibility changes. This prevents any problems arising due to changes coming when the private object is deleted. Pick-to: 5.15 Change-Id: Icce0cc0cff54ce35ddf6be74e32bb0bdeff6d0fc Reviewed-by: Richard Moe Gustavsen --- src/quicktemplates2/qquickcontrol.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/quicktemplates2') diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp index 22b7f922..e9b66d9e 100644 --- a/src/quicktemplates2/qquickcontrol.cpp +++ b/src/quicktemplates2/qquickcontrol.cpp @@ -159,9 +159,6 @@ QQuickControlPrivate::QQuickControlPrivate() QQuickControlPrivate::~QQuickControlPrivate() { -#if QT_CONFIG(accessibility) - QAccessible::removeActivationObserver(this); -#endif } void QQuickControlPrivate::init() @@ -883,6 +880,9 @@ QQuickControl::~QQuickControl() Q_D(QQuickControl); d->removeImplicitSizeListener(d->background, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry); d->removeImplicitSizeListener(d->contentItem); +#if QT_CONFIG(accessibility) + QAccessible::removeActivationObserver(d); +#endif } void QQuickControl::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value) -- cgit v1.2.3