Workaround for crash on derefWindow on application shutdown

Ideally there shouldn't be nullptrs in the list. This fix will however
prevent crashes, until we find out why.

Fixes: QTBUG-116426
Pick-to: 6.6.2 6.5
Change-Id: I2c85ad73832ab4d8b9992b4d8e661758fae85ac7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5d79b207c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fe0b983fc5)
This commit is contained in:
Robert Griebl 2024-01-18 02:01:34 +01:00 committed by Qt Cherry-pick Bot
parent f17168ef87
commit e6811c930e
1 changed files with 2 additions and 2 deletions

View File

@ -3045,7 +3045,7 @@ void QQuickItemPrivate::derefWindow()
paintNode = nullptr;
for (int ii = 0; ii < childItems.size(); ++ii) {
QQuickItem *child = childItems.at(ii);
if (QQuickItem *child = childItems.at(ii))
QQuickItemPrivate::get(child)->derefWindow();
}