summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-03-12 16:59:00 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-16 09:11:56 +0000
commit5c2df051cdf8768424fe250bec99b67844df9a36 (patch)
treeb2d8d9ff5358bfa794c7291a6c830a5e7e3cf67f /src/gui/image
parent88851fb3b0439e3eac197538bf76f4050a7ac018 (diff)
Always overwrite QPixmap data on loadFromData
Reusing the previous QPlatformPixmap breaks implicit sharing. It changes the contents for all QPixmaps using the sample QPlatformPixmap. Task-number: QTBUG-43384 Change-Id: Ic0792088daa8c2dcb5d7d311a0fd7415d7b5e097 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qpixmap.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index db6ae54d26..4ee64cddcd 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -824,8 +824,7 @@ bool QPixmap::loadFromData(const uchar *buf, uint len, const char *format, Qt::I
return false;
}
- if (!data)
- data = QPlatformPixmap::create(0, 0, QPlatformPixmap::PixmapType);
+ data = QPlatformPixmap::create(0, 0, QPlatformPixmap::PixmapType);
if (data->fromData(buf, len, format, flags))
return true;