diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-12-18 16:48:10 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-12-18 16:48:10 (GMT) |
commit | f708b248aec810a1dcad1f13e1c16390244c9834 (patch) | |
tree | 75c120a9a76ce9667504c9b9b3b9296ac5889fd6 /src/gui/image/qpixmap.cpp | |
parent | 51be60532af93ac6526e76db4085283465c5baa6 (diff) | |
download | Qt-f708b248aec810a1dcad1f13e1c16390244c9834.zip Qt-f708b248aec810a1dcad1f13e1c16390244c9834.tar.gz Qt-f708b248aec810a1dcad1f13e1c16390244c9834.tar.bz2 |
Fixed QPixmap::load() to not modify referenced copies.
This is a bad regression from 4.5. QPixmap::load() would modify all
references to the same QPixmap object.
Task-number: QTBUG-6840
Reviewed-by: Kim
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 617cfe5..7e4597e 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -831,14 +831,13 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers if (QPixmapCache::find(key, *this)) return true; - if (!data) - data = QPixmapData::create(0, 0, QPixmapData::PixmapType); - - if (data->fromFile(fileName, format, flags)) { + QPixmapData *tmp = QPixmapData::create(0, 0, QPixmapData::PixmapType); + if (tmp->fromFile(fileName, format, flags)) { + data = tmp; QPixmapCache::insert(key, *this); return true; } - + delete tmp; return false; } |