mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +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);
|
||||
for (auto& url : _resourcesToBeGotten) {
|
||||
if (url.scheme() == URL_SCHEME_ATP) {
|
||||
_resourcesToBeGotten.removeAll(url);
|
||||
auto it = _resourcesToBeGotten.begin();
|
||||
while (it != _resourcesToBeGotten.end()) {
|
||||
if (it->scheme() == URL_SCHEME_ATP) {
|
||||
it = _resourcesToBeGotten.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue