aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-09-10 14:35:00 +0200
committerAndy Shaw <andy.shaw@qt.io>2020-09-15 09:34:46 +0000
commit60d798f2a445552165fae3e622129f5356f61a0b (patch)
treeb781a1220e2e5019ec83da3b680f9e718b87b6ad /src/quicktemplates2
parent97d2d271233246ed8a0d8930c9110603bf7b03bd (diff)
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 <richard.gustavsen@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp6
1 files changed, 3 insertions, 3 deletions
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)