REPRODUCIBILITY: 100% (always)
OS VERSION: 5.0.0.68
HARDWARE: Sony Xperia XZ2
UI LANGUAGE: English
REGRESSION: don’t know
DESCRIPTION:
Possibly due to a bug in Silica, setting PagedView’s model to an item of a Loader and then destructing it causes the application to crash.
PRECONDITIONS:
SailfishOS installed
STEPS TO REPRODUCE:
- Run a QML application like this (either by making an actual application, or by saving the code in a QML file and running it using
qmlscene /path/to/file.qml):
import QtQuick 2.0
import Sailfish.Silica 1.0
ApplicationWindow {
initialPage: Component {
Page {
Component {
id: page2
Page {
Loader {
id: modelLoader
sourceComponent: Component {
ListModel {
ListElement {name: 1}
ListElement {name: 2}
ListElement {name: 3}
}
}
}
PagedView {
anchors.fill: parent
model: modelLoader.item
delegate: Component {
Label {
text: name
}
}
}
}
}
Timer {
id: timer
interval: 0
onTriggered: pageStack.push(page2)
running: true
}
}
}
}
- Run the code snipper and wait for the application window to load
- Try to close the newly opened page with PagedView
EXPECTED RESULT:
The page is closed, PagedView instance is destructed successfully and the application continues to run.
ACTUAL RESULT:
Application crashes
MODIFICATIONS:
Patchmanager (no silica-related patches), openrepos, chum
ADDITIONAL INFORMATION:
A possible workaround is to put the model Loader inside the PagedView instance, making it the Loader’s parent.