fix: don't mutate QHash while iterating over it
Even though it was using a QMutableHashIterator, sometimes it didn't work quite well, so this is a bit better. Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
parent
f4b207220c
commit
7b27f200b1
@ -119,11 +119,9 @@ void EnsureMetadataTask::executeTask()
|
||||
}
|
||||
|
||||
auto invalidade_leftover = [this] {
|
||||
QMutableHashIterator<QString, Mod*> mods_iter(m_mods);
|
||||
while (mods_iter.hasNext()) {
|
||||
auto mod = mods_iter.next();
|
||||
emitFail(mod.value(), mod.key());
|
||||
}
|
||||
for (auto mod = m_mods.constBegin(); mod != m_mods.constEnd(); mod++)
|
||||
emitFail(mod.value(), mod.key(), RemoveFromList::No);
|
||||
m_mods.clear();
|
||||
|
||||
emitSucceeded();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user