diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-09-29 07:50:07 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-09-29 07:55:32 (GMT) |
commit | c999065d5090a64192f96bed78c5224490409d6a (patch) | |
tree | b3c96a1a0902fd948397eae82359637dc50cf307 /src/gui/image/qpixmapcache_p.h | |
parent | dad31edd2d5be5a2902f6b011910f418882c9367 (diff) | |
download | Qt-c999065d5090a64192f96bed78c5224490409d6a.zip Qt-c999065d5090a64192f96bed78c5224490409d6a.tar.gz Qt-c999065d5090a64192f96bed78c5224490409d6a.tar.bz2 |
Fix a bug in QPixmapCache when the cache is trimmed by QCache.
There was a bug in QPixmapCache when QCache trims the content, some keys
were not invalidated. The ifdef for WinCE (that i removed) was a wrong
fix, it let the auto-test pass but it doesn't fix the bug. The approach
here is to add a QPixmapCacheEntry that release the key it owns when
QCache deletes it : we are now sure that nothing happen in our back.
Reviewed-by:paul
Reviewed-by:trond
Diffstat (limited to 'src/gui/image/qpixmapcache_p.h')
-rw-r--r-- | src/gui/image/qpixmapcache_p.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/image/qpixmapcache_p.h b/src/gui/image/qpixmapcache_p.h index 33f93bc..84e4a03 100644 --- a/src/gui/image/qpixmapcache_p.h +++ b/src/gui/image/qpixmapcache_p.h @@ -76,10 +76,10 @@ public: }; // XXX: hw: is this a general concept we need to abstract? -class QDetachedPixmap : public QPixmap +class QPixmapCacheEntry : public QPixmap { public: - QDetachedPixmap(const QPixmap &pix) : QPixmap(pix) + QPixmapCacheEntry(const QPixmapCache::Key &key, const QPixmap &pix) : QPixmap(pix), key(key) { if (data && data->classId() == QPixmapData::RasterClass) { QRasterPixmapData *d = static_cast<QRasterPixmapData*>(data.data()); @@ -91,6 +91,8 @@ public: } } } + ~QPixmapCacheEntry(); + QPixmapCache::Key key; }; QT_END_NAMESPACE |