Skip to content

Draft: ScrollBar: fix crash on exit when flickable created before ScrollView

ivan tkachenko requested to merge ratijas/qtdeclarative:pick-430512/9 into kde/5.15

In the case from the related QTBUG-106118, the ListView is declared before the ScrollView, so when the QObject destruction happens, it gets destroyed first. The ScrollView being destroyed causes the attached ScrollBar object to be destroyed, which causes the attached object to access the flickable (ListView) which has already been destroyed. So a workaround for the crash is to declare the ListView after the ScrollView.

With typical usage where ScrollView is used as-is, ScrollView (and hence QQuickScrollBarAttached) is destroyed before the flickable.

This patch also adds a PRINT_LISTENERS debugging helper, as item change listener crashes can be difficult to debug.

Fixes: QTBUG-106106 Pick-to: 6.2 6.4 Change-Id: I8d0d5544ea28c1f1557abdc38d48b26d21a7f1f5 Reviewed-by: Volker Hilsheimer volker.hilsheimer@qt.io Reviewed-by: Shawn Rutledge shawn.rutledge@qt.io

Manually cherry-picked from c6f51533. Due to split repo in Qt 5 branch, second part of that patch is to be merged in qtquickcontrols2.

Merge request reports