diff options
author | axis <qt-info@nokia.com> | 2009-10-06 15:05:50 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2009-10-07 11:51:25 (GMT) |
commit | 330dc1e5895a8950615a9bbf26154f5387b023b1 (patch) | |
tree | 524a929aedf73626de7ad878d93bfc15fa6fb245 | |
parent | 2c579ce42d89ad4cb8c03231b41ae496f24fad4b (diff) | |
download | Qt-330dc1e5895a8950615a9bbf26154f5387b023b1.zip Qt-330dc1e5895a8950615a9bbf26154f5387b023b1.tar.gz Qt-330dc1e5895a8950615a9bbf26154f5387b023b1.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
-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(); } } |