diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2023-08-25 16:01:03 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-08-29 19:34:16 +0000 |
commit | bd0158ff2b16acf8ecb0169fdea697e9ea15b58d (patch) | |
tree | cec3b645be0b5b3d73942d7a6357898cbeca5ebc | |
parent | 0ca0863e5ff71a60b1ea89fce2ca8e9938bb26d4 (diff) |
Avoid unsigned->signed refCount conversion underflow
refCount is uint; there's no reason to convert it to int, even though
it's normally small enough to fit. Avoid warnings both now and in the
future by using auto.
Task-number: QTBUG-114953
Change-Id: I93fd50b78bcf371f9ba56c6626334b435bac0e7d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit c6cda495c636a204cb6ce2a7a1af689fb618a663)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 0854bb764d..e6aca2de49 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -1287,7 +1287,7 @@ QQuickPixmapStore::~QQuickPixmapStore() // unreference all (leaked) pixmaps const auto cache = m_cache; // NOTE: intentional copy (QTBUG-65077); releasing items from the cache modifies m_cache. for (auto *pixmap : cache) { - int currRefCount = pixmap->refCount; + auto currRefCount = pixmap->refCount; if (currRefCount) { #ifndef QT_NO_DEBUG leakedPixmaps++; |