aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollindicator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickscrollindicator.cpp')
-rw-r--r--src/quicktemplates2/qquickscrollindicator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickscrollindicator.cpp b/src/quicktemplates2/qquickscrollindicator.cpp
index c98a1956..a57cfbb6 100644
--- a/src/quicktemplates2/qquickscrollindicator.cpp
+++ b/src/quicktemplates2/qquickscrollindicator.cpp
@@ -412,6 +412,9 @@ QQuickScrollIndicatorAttached::~QQuickScrollIndicatorAttached()
QQuickItemPrivate::get(d->horizontal)->removeItemChangeListener(d, horizontalChangeTypes);
if (d->vertical)
QQuickItemPrivate::get(d->vertical)->removeItemChangeListener(d,verticalChangeTypes);
+ // NOTE: Use removeItemChangeListener(Geometry) instead of updateOrRemoveGeometryChangeListener(Size).
+ // The latter doesn't remove the listener but only resets its types. Thus, it leaves behind a dangling
+ // pointer on destruction.
QQuickItemPrivate::get(d->flickable)->removeItemChangeListener(d, QQuickItemPrivate::Geometry);
}
}