Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.12.6, 5.12.7, 5.12.8, 5.12.12
Description
When a ListView is created inside of a component loaded by a Loader, and then the Loader's source or sourceComponent changes, it is possible that the ListView may continue incubating delegates even after it has been removed by the Loader. At this point, if the ListView's delegate contains an Item containing a State with a "when" property, the application will crash. The crash occurs while attempting to evaluate the QQmlBinding for the State's "when" property due to de-referencing the QQmlEngine from the binding's context, which at this point is null due to being unloaded. (See stack trace, disassembly images below)
I've attached a small example to reproduce the issue. Simply click on the window several times until the crash occurs. It should occur within a few times of clicking.
A simple workaround for the crash is to place the entire ListView delegate in a Loader of its own.
Note that this issue affects Qt 5.12, but does not affect Qt 5.15, likely due to refactoring that took place in QQuickStateGroup and other possibly other locations. However, since this crash can easily result from entirely valid and reasonable QML code, we would ask that it be fixed in the Qt 5.12 LTS line.
Attachments
Issue Links
- relates to
-
QTBUG-86695 [REG: 5.12 -> 5.14] Broken State::when behavior after suspicious change
- Closed
For Gerrit Dashboard: QTBUG-84914 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
353944,7 | QQuickState(Group): Restructure when notification logic | dev | qt/qtdeclarative | Status: ABANDONED | -1 | 0 |