Go to file
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
bin Merge branch 'refactor' 2011-09-13 08:54:45 +02:00
config.profiles Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
config.tests Fix warning caused by putting .mm files in SOURCES 2011-09-26 16:05:36 +02:00
dist Rename Qt::escape to QString::toHtmlEscaped, add compat method 2011-09-29 15:22:07 +02:00
doc/src Rename Qt::escape to QString::toHtmlEscaped, add compat method 2011-09-29 15:22:07 +02:00
examples Get rid of the last traces of QMimeSource 2011-09-29 08:54:06 +02:00
lib Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
mkspecs Remove stale QtDeclarative dependency on QtOpenGL 2011-09-20 19:18:19 +02:00
qmake Merge branch 'refactor' 2011-09-13 08:54:45 +02:00
src Prevent QPixmapCache potentially growing indefinitely. 2011-10-03 11:55:32 +02:00
tests Prevent QPixmapCache potentially growing indefinitely. 2011-10-03 11:55:32 +02:00
tools Ensure build_all is propagated to all modules when appropriate. 2011-09-15 01:03:11 +02:00
util Move the documentation for the classes to their modules. 2011-10-03 09:56:09 +02:00
.gitattributes Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
.gitignore Update .gitignore 2011-10-03 05:58:44 +02:00
.gitmodules Add QtV8 library to QtBase 2011-08-29 10:16:01 +02:00
.tag Added .tag file with Git revision. 2011-05-03 16:23:49 +02:00
configure Remove the remaining traces of QT3_SUPPORT 2011-10-03 05:59:07 +02:00
configure.exe New configure.exe binary 2011-09-05 08:55:31 +02:00
header.BSD Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
header.FDL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL Update licenseheader text in source files for qtbase Qt module 2011-05-24 12:34:08 +03:00
header.LGPL-ONLY Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
INSTALL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LGPL_EXCEPTION.txt Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.FDL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.LGPL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
LICENSE.PREVIEW.COMMERCIAL Initial import from the monolithic Qt. 2011-04-27 12:05:43 +02:00
qtbase.pro Fix make confclean 2011-09-12 16:03:47 +02:00
sync.profile Remove uilib and QtUiTools from QtBase 2011-09-13 20:11:40 +02:00