Merge pull request #15725 from hyperlogic/bug-fix/resource-cache-crash

Crash fix for ResourceCache::getResource()
This commit is contained in:
Shannon Romano 2019-06-10 16:52:59 -07:00 committed by GitHub
commit d43365b6d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -346,7 +346,7 @@ void ResourceCache::setRequestLimit(uint32_t limit) {
QSharedPointer<Resource> ResourceCache::getResource(const QUrl& url, const QUrl& fallback, void* extra, size_t extraHash) {
QSharedPointer<Resource> resource;
{
QReadLocker locker(&_resourcesLock);
QWriteLocker locker(&_resourcesLock);
auto& resourcesWithExtraHash = _resources[url];
auto resourcesWithExtraHashIter = resourcesWithExtraHash.find(extraHash);
if (resourcesWithExtraHashIter != resourcesWithExtraHash.end()) {