Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.5.3, 6.8.0
-
None
Description
While developing a chat app, I got into a bug that cause a constant memory leak while the app hangs indefinitely. To easily reproduce the bug, just run the following code and try to scroll upward, the app will hang/crash/try to allocate infinite amount of RAM. At least on my machine (Macbook Air M1 running macOS 15.0.1).
pragma ComponentBehavior: Bound import QtQuick import QtQuick.Controls ApplicationWindow { id: appWindow width: 400 height: 400 visible: true ListModel { id: testModel Component.onCompleted: { for (let i = 0; i < 20; i++) { testModel.append({}); } } } ListView { id: listView width: parent.width anchors.top: parent.top anchors.bottom: testButton.top model: testModel delegate: Rectangle { width: listView.width height: 50 color: index % 2 ? "red" : "green" required property int index Component.onCompleted: { listView.positionViewAtEnd(); } } ScrollBar.vertical: ScrollBar {} } Button { id: testButton anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter text: "Click me" onClicked: { testModel.append({}); } } }