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>bb10
parent
88851fb3b0
commit
5c2df051cd
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue