mirror of
https://github.com/quickshell-mirror/quickshell.git
synced 2026-10-28 02:55:05 +00:00
core/scriptmodel: detatch mValues when accessed during update
Fixes iterator invalidation caused by the QML engine.
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user