mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:12:53 +02:00
Merge pull request #7680 from Atlante45/fix/clear-atp-cache
Don't use invalidated iterators
This commit is contained in:
commit
523d365ce7
1 changed files with 6 additions and 3 deletions
|
@ -155,9 +155,12 @@ void ResourceCache::clearATPAssets() {
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
QWriteLocker locker(&_resourcesToBeGottenLock);
|
QWriteLocker locker(&_resourcesToBeGottenLock);
|
||||||
for (auto& url : _resourcesToBeGotten) {
|
auto it = _resourcesToBeGotten.begin();
|
||||||
if (url.scheme() == URL_SCHEME_ATP) {
|
while (it != _resourcesToBeGotten.end()) {
|
||||||
_resourcesToBeGotten.removeAll(url);
|
if (it->scheme() == URL_SCHEME_ATP) {
|
||||||
|
it = _resourcesToBeGotten.erase(it);
|
||||||
|
} else {
|
||||||
|
++it;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue