diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-04-15 15:16:41 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-04-15 19:59:27 +0000 |
commit | a4a83f52f9ee862d703c21dcd9915ebfd7c72ac5 (patch) | |
tree | d44423054d0eedbc65f683784f8d23efc984d7fd /src/opengl | |
parent | 418b6f6899ee414aff29c91a4ae17eed8791a617 (diff) |
OGLTextureCache::insert - make sure it did not fail
QGLTextureCache is using QCache internally, QCache in theory
can delete the object we are trying to insert (in case the cost > maxCost).
Vague comments in the code suggest that this can never happen.
Q_ASSERT assert this.
Found by coverity, CID 11765
Change-Id: I34ef114b9607926cd5e7d2baed4b63051cf87cff
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 5c8c1d58eb..a17beb898d 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1918,7 +1918,8 @@ void QGLTextureCache::insert(QGLContext* ctx, qint64 key, QGLTexture* texture, i { QWriteLocker locker(&m_lock); const QGLTextureCacheKey cacheKey = {key, QGLContextPrivate::contextGroup(ctx)}; - m_cache.insert(cacheKey, texture, cost); + const bool inserted = m_cache.insert(cacheKey, texture, cost); + Q_UNUSED(inserted) Q_ASSERT(inserted); } void QGLTextureCache::remove(qint64 key) |