summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2017-07-19 12:37:24 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2017-07-19 10:47:55 +0000
commit0e9ea9451174aeeb78f41f0cc213373e8ce76e5a (patch)
treeec2fa19af44e9498b593c9cd5e1a43c22fa45c94 /src
parent13bceecc6bd3046772b2e662e08e0de3b37603a7 (diff)
QPMCache::remove(): Do not dereference erased iterator
Fixes a crash in tst_QGL::textureCleanup() (developer build). Amends 467b15a20c3d6eb611ea5f6ccffd5fc0df81b0c4. Change-Id: I7026b3c2a27c02a80b995fde67a832dc2d19031d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmapcache.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/image/qpixmapcache.cpp b/src/gui/image/qpixmapcache.cpp
index 625e145647..742aa31ba9 100644
--- a/src/gui/image/qpixmapcache.cpp
+++ b/src/gui/image/qpixmapcache.cpp
@@ -383,8 +383,9 @@ bool QPMCache::remove(const QString &key)
//The key was not in the cache
if (cacheKey == cacheKeys.constEnd())
return false;
+ const bool result = QCache<QPixmapCache::Key, QPixmapCacheEntry>::remove(cacheKey.value());
cacheKeys.erase(cacheKey);
- return QCache<QPixmapCache::Key, QPixmapCacheEntry>::remove(cacheKey.value());
+ return result;
}
bool QPMCache::remove(const QPixmapCache::Key &key)