Commit d3f28022 authored by David Redondo's avatar David Redondo 🏎
Browse files

Fix crash with text face

A binding involving the two arrays won't update when we change just the
contents of the arrays so we crashed later in QQmlData::wasDeleted when
trying to access the objects which were inside but deleted.


(cherry picked from commit 90548f3e)
parent 0e0d40f6
...@@ -104,8 +104,14 @@ ColumnLayout { ...@@ -104,8 +104,14 @@ ColumnLayout {
Sensors.Sensor { sensorId: modelData } Sensors.Sensor { sensorId: modelData }
onObjectAdded: root.highPrioritySensors.push(object) onObjectAdded: {
onObjectRemoved: root.highPrioritySensors.splice(root.highPrioritySensors.indexOf(object), 1) root.highPrioritySensors.push(object)
root.highPrioritySensors = root.highPrioritySensors
}
onObjectRemoved: {
root.highPrioritySensors.splice(root.highPrioritySensors.indexOf(object), 1)
root.highPrioritySensors = root.highPrioritySensors
}
} }
Instantiator { Instantiator {
...@@ -113,7 +119,13 @@ ColumnLayout { ...@@ -113,7 +119,13 @@ ColumnLayout {
Sensors.Sensor { sensorId: modelData } Sensors.Sensor { sensorId: modelData }
onObjectAdded: root.lowPrioritySensors.push(object) onObjectAdded: {
onObjectRemoved: root.lowPrioritySensors.splice(root.lowPrioritySensors.indexOf(object), 1) root.lowPrioritySensors.push(object)
root.lowPrioritySensors = root.lowPrioritySensors
}
onObjectRemoved: {
root.lowPrioritySensors.splice(root.lowPrioritySensors.indexOf(object), 1)
root.lowPrioritySensors = root.lowPrioritySensors
}
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment