summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlessandro Portale <alessandro.portale@nokia.com>2009-10-05 17:43:13 (GMT)
committerAlessandro Portale <alessandro.portale@nokia.com>2009-10-05 17:45:25 (GMT)
commit064674426ef0c446561b0c338441bb7d5ca091bf (patch)
tree12a60220b3d3fca16e3e15fb4b7b42741f8a989e /src
parent8dbbff1dec967d043255e8cea2c4d32be3c1f9cd (diff)
downloadQt-064674426ef0c446561b0c338441bb7d5ca091bf.zip
Qt-064674426ef0c446561b0c338441bb7d5ca091bf.tar.gz
Qt-064674426ef0c446561b0c338441bb7d5ca091bf.tar.bz2
Symbain crash fix for QPixmap->QImage conversion.
In some cases the QImage, returned by QS60PixmapData::toImage() image an invalid pointer. That led to reproducable crashes on 3.1 Device and Emulator when starting a drag in the FridgeMagnets demo. Jani Hautakangas created this fix and I tested it on 3.1 Device and Emulator confirming that the crash is gone. Rev-By: Jani Hautakangas Rev-By: Alessandro Portale
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmap_s60.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp
index 326dd10..37b6438 100644
--- a/src/gui/image/qpixmap_s60.cpp
+++ b/src/gui/image/qpixmap_s60.cpp
@@ -664,7 +664,12 @@ void QS60PixmapData::setAlphaChannel(const QPixmap &alphaChannel)
QImage QS60PixmapData::toImage() const
{
- return image;
+ QS60PixmapData *that = const_cast<QS60PixmapData*>(this);
+ that->beginDataAccess();
+ QImage copy = that->image.copy();
+ that->endDataAccess();
+
+ return copy;
}
QPaintEngine* QS60PixmapData::paintEngine() const