mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
fix(bar): defer update to next cycle
This commit is contained in:
+8
-3
@@ -142,13 +142,18 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize models — deferred to next event-loop tick via Qt.callLater to avoid
|
||||
// re-entrant incubation: Component.onCompleted fires during QQmlObjectCreator::finalize,
|
||||
// Initialize models — deferred via Timer (Qt.callLater can fire in same event cycle)
|
||||
// to avoid re-entrant incubation: Component.onCompleted fires during finalization,
|
||||
// and ListModel.append synchronously creates Repeater delegates whose own finalization
|
||||
// can corrupt the V4 heap (SIGSEGV in QV4::Object::insertMember).
|
||||
Timer {
|
||||
id: initModelsTimer
|
||||
interval: 0
|
||||
onTriggered: root._initModels()
|
||||
}
|
||||
Component.onCompleted: {
|
||||
Logger.d("Bar", "Bar Component.onCompleted for screen:", screen?.name);
|
||||
Qt.callLater(root._initModels);
|
||||
initModelsTimer.restart();
|
||||
}
|
||||
|
||||
function _initModels() {
|
||||
|
||||
Reference in New Issue
Block a user