diff options
author | axis <qt-info@nokia.com> | 2009-10-06 15:05:50 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-07 16:24:00 (GMT) |
commit | cf07c93a83a64be1590b6bdddb46f7cafb6fcf05 (patch) | |
tree | 6cdb1e82a7b12f987d71882bde36aef26d25ccd8 | |
parent | 00db2d0b1f069a1e1a71b3f1175dfb0dff71cae1 (diff) | |
download | Qt-cf07c93a83a64be1590b6bdddb46f7cafb6fcf05.zip Qt-cf07c93a83a64be1590b6bdddb46f7cafb6fcf05.tar.gz Qt-cf07c93a83a64be1590b6bdddb46f7cafb6fcf05.tar.bz2 |
Fixed a crash bug on S60 SDK 3.1.
The crash was caused by the image data not being locked before being
accessed.
Also avoided an unnecessary detach copy by making the image variable
a reference.
RevBy: Jani Hautakangas
Task: QTBUG-4705
AutoTest: QWidget passed
(cherry picked from commit 330dc1e5895a8950615a9bbf26154f5387b023b1)
-rw-r--r-- | src/gui/painting/qwindowsurface_s60.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp index 664ad48..dc4e43b 100644 --- a/src/gui/painting/qwindowsurface_s60.cpp +++ b/src/gui/painting/qwindowsurface_s60.cpp @@ -85,7 +85,9 @@ QS60WindowSurface::~QS60WindowSurface() void QS60WindowSurface::beginPaint(const QRegion &rgn) { if (!qt_widget_private(window())->isOpaque) { - QImage image = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data())->image; + QS60PixmapData *pixmapData = static_cast<QS60PixmapData *>(d_ptr->device.data_ptr().data()); + pixmapData->beginDataAccess(); + QImage &image = pixmapData->image; QRgb *data = reinterpret_cast<QRgb *>(image.bits()); const int row_stride = image.bytesPerLine() / 4; @@ -103,6 +105,7 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn) row += row_stride; } } + pixmapData->endDataAccess(); } } |