From 330dc1e5895a8950615a9bbf26154f5387b023b1 Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 6 Oct 2009 17:05:50 +0200 Subject: 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 --- src/gui/painting/qwindowsurface_s60.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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(d_ptr->device.data_ptr().data())->image; + QS60PixmapData *pixmapData = static_cast(d_ptr->device.data_ptr().data()); + pixmapData->beginDataAccess(); + QImage &image = pixmapData->image; QRgb *data = reinterpret_cast(image.bits()); const int row_stride = image.bytesPerLine() / 4; @@ -103,6 +105,7 @@ void QS60WindowSurface::beginPaint(const QRegion &rgn) row += row_stride; } } + pixmapData->endDataAccess(); } } -- cgit v0.12