qt5base-lts/tests/auto/gui/image
Samuel Rødal 677cf76340 Prevent QPixmapCache potentially growing indefinitely.
QPixmapCache has until now refused to throw out shared pixmaps, i.e.
ones that still have shallow copies lying around. This leads to problems
when someone inserts two shallow copies using different keys, causing
the cache itself containing multiple shallow copies and thus forever
refusing to throw out those entries.

It's rather easy for this to accidentally happen in a user application
since QPixmap::load() or QPixmap(const QString &fileName, ...)
automatically cache the pixmap in the QPixmapCache, thus if the user
then calls QPixmapCache::insert() on the same pixmap or a shallow copy
it is locked in the QPixmapCache forever.

The only reason for not throwing out a pixmap that's shared would be to
prevent re-loading a pixmap from file when a user has a direct reference
to it in his application, but in that case the user is unlikely to
re-load the pixmap from file in any case. Therefore it seems the best
fix is to get rid of this limitation.

Task-number: QTBUG-21359
Reviewed-by: John Brooks
Reviewed-by: Olivier Goffart
(cherry picked from commit 7ab0bed3a56d46c386e65abc381264c57137cb43)

Change-Id: I46dce19227e19a25e0287cf7372177430da15a66
Reviewed-on: http://codereview.qt-project.org/4563
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2011-10-03 11:55:32 +02:00
..
qicoimageformat Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qicon Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qimage Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qimageiohandler Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
qimagereader Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qimagewriter Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qmovie Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qpicture Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
qpixmap Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
qpixmapcache Prevent QPixmapCache potentially growing indefinitely. 2011-10-03 11:55:32 +02:00
qpixmapfilter Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00
qvolatileimage Remove Symbian-specific code from tests. 2011-09-29 06:41:42 +02:00
image.pro Moved gui autotests into new directory structure 2011-09-01 10:59:49 +02:00