diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2009-10-05 17:43:13 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-10-06 03:14:44 (GMT) |
commit | 3066b0e55e578896005b4419b8ceff05570fa8ff (patch) | |
tree | 4fe230a1118d2b357e056a98c6e1bd7554f11414 | |
parent | d4b9dd763e69a831c169c33d1aa959a4e0b47bed (diff) | |
download | Qt-3066b0e55e578896005b4419b8ceff05570fa8ff.zip Qt-3066b0e55e578896005b4419b8ceff05570fa8ff.tar.gz Qt-3066b0e55e578896005b4419b8ceff05570fa8ff.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
(cherry picked from commit 064674426ef0c446561b0c338441bb7d5ca091bf)
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 7 |
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 |