Skip to content

Fix potential crash in SizeGroup

David Edmundson requested to merge work/size_group_fix into master

SizeGroup keeps a cache of a list of items, and when one updates does calculations based on all items.

This list is stored as a list of QPointers as we don't explicitly track deletion.

We have a list of items and guard for deletion, but they're QML owned. So there's a point in time when it's pending deletion with the garbage collector but the lower level object isn't managed by an engine.

As we go via QQmlProperty(item, QStringLiteral("Layout.preferredWidth"), qmlContext(item)).write(maxWidth) this is problematic.

This is a somewhat blind fix from reading the backtrace, I did not reproduce.

BUG: 434079

Merge request reports