core/scriptmodel: detatch mValues when accessed during update

Fixes iterator invalidation caused by the QML engine.
This commit is contained in:
outfoxxed committed 2025-04-06 01:40:55 -07:00
1 parent 3a97da0029
commit ed528268e0
2 files changed
+11 -1

No files matched your search

+3
View File
@@ -12,6 +12,7 @@
#include <qvariant.h>
void ScriptModel::updateValuesUnique(const QVariantList& newValues) {
this->hasActiveIterators = true;
this->mValues.reserve(newValues.size());
auto iter = this->mValues.begin();
@@ -112,6 +113,8 @@ void ScriptModel::updateValuesUnique(const QVariantList& newValues) {
++newIter;
}
}
this->hasActiveIterators = false;
}
void ScriptModel::setValues(const QVariantList& newValues) {