qt5base-lts/src
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
..
3rdparty Revert accidental v8 submodule version downgrade 2011-09-15 09:11:35 +02:00
corelib Prevent QPixmapCache potentially growing indefinitely. 2011-10-03 11:55:32 +02:00
dbus Make the DBus timeout configurable in QDBusAbstractInterface. 2011-08-25 11:36:52 +02:00
gui Rename description to localizedDescription in Action interface. 2011-10-03 09:59:27 +02:00
modules Mac: fix linking with Qt frameworks which don't exist at qmake time 2011-09-17 01:32:51 +02:00
network Fix compiler warnings. 2011-09-28 03:17:51 +02:00
opengl Make all uses of QBasicAtomicInt and Pointer use load() and store() 2011-10-03 07:57:41 +02:00
platformsupport Make qtbase build with Qt-in-namespace again 2011-09-28 12:18:37 +02:00
plugins Rename description to localizedDescription in Action interface. 2011-10-03 09:59:27 +02:00
printsupport Move the documentation for the classes to their modules. 2011-10-03 09:56:09 +02:00
s60installs update def files 2011-05-11 16:40:09 +02:00
s60main Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
sql Fix compiler warnings. 2011-09-28 03:17:51 +02:00
testlib Make all uses of QBasicAtomicInt and Pointer use load() and store() 2011-10-03 07:57:41 +02:00
tools Remove the remaining traces of QT3_SUPPORT 2011-10-03 05:59:07 +02:00
v8 Merge branch 'refactor' 2011-09-13 08:54:45 +02:00
widgets Use interfaces in QAccessibleWidget childAt. 2011-10-03 09:58:27 +02:00
winmain Windows: fixed qtmain.lib not going to `lib' directory 2011-07-26 03:27:34 +02:00
xml QXmlStream lives in QtCore 2011-08-11 16:21:14 +02:00
qbase.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
qt_install.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
qt_targets.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
src.pro Remove uilib and QtUiTools from QtBase 2011-09-13 20:11:40 +02:00