Details
-
Bug
-
Resolution: Incomplete
-
P1: Critical
-
None
-
5.9.0
-
None
-
Qt: qt-opensource-linux-x64-5.9.0
Build host: Ubuntu 64bit
Description
A custom contentItem inside a ComboBox has a property which reads a role from a ListElement in the ListModel (via ListModel.get()). When the ComboBox is destroyed, a segfault happens (e.g. the app is closed, or when it is unloaded from a Loader).
The segfault started to appear after upgrading from Qt 5.8 to Qt 5.9.
Placing ListModel before or after the ComboBox (thus changing the destruction sequence) does not help avoid the crash. When the ListModel is directly assigned to ComboBox's 'model' property inside the ComboBox, the crush does not happen.
Steps to reproduce: Run the app, then close the app's window - a segfault happens.
The bug is 100% reproducable (no stack trace is attached, because the used Qt was installed from a binary, which has no debug symbols)
import QtQuick 2.7 import QtQuick.Controls 2.0 ApplicationWindow { visible: true width: 640 height: 480 ComboBox { id: comboBox model: colorsModel delegate: ItemDelegate { Text { text: name } } contentItem: Text { Component.onDestruction: console.log("text") // When colorsModel.get() is not used, the crash does not happen. text: colorsModel.get(0 /*comboBox.currentIndex*/).name } } ListModel { id: colorsModel ListElement { name: "Transparent"; value: "transparent" } ListElement { name: "Black"; value: "#000000" } Component.onDestruction: console.log("model") } }