Qtmoko2-qte

Qtmoko2-qte Commit Details

Date:2010-07-19 16:44:26 (14 years 7 months ago)
Author:axis
Commit:d4cc1dcea5b4116767cfee0ec45bfba72dc011ff
Parents: cc4b3c0f9c66a586df67992f5b3687fbab4029d6
Message:Fixed a QSplashScreen hanging bug in S60 3.1 devices.

QSymbianBitmapDataAccess is used to provide access to the bitmap heap
in a manner that locks correctly on all platform versions. The
heapWasLocked variable was meant to protect against the case where
the heap is locked recursively. However, it failed to take into
account the case where the same QSymbianBitmapDataAccess object was
used to lock recursively. In this case the variable would be changed
to true on the second lock, which means that the lock would never be
released again.

This was fixed by making the access reference counted instead. Since
the bitmap heap lock is global, the refcount was made global as well.

Task: QTBUG-11129
RevBy: Jason Barron
AutoTest: Works again. It was hanging before this fix.
Changes:
Msrc/gui/image/qpixmap_s60.cpp (3 diffs)

File differences

src/gui/image/qpixmap_s60.cpp
157157
158158
159159
160
160
161161
162162
163
163
164164
165165
166166
......
169169
170170
171171
172
173
174
172
173
174
175
175176
177
178
179
176180
177181
178182
179183
184
185
180186
181
187
182188
183189
184190
......
186192
187193
188194
195
196
189197
190198
191199
{
public:
    bool heapWasLocked;
    static int heapRefCount;
    QSysInfo::SymbianVersion symbianVersion;
    explicit QSymbianBitmapDataAccess() : heapWasLocked(false)
    explicit QSymbianBitmapDataAccess()
    {
        symbianVersion = QSysInfo::symbianVersion();
    };
    inline void beginDataAccess(CFbsBitmap *bitmap)
    {
        if (symbianVersion == QSysInfo::SV_9_2)
            heapWasLocked = qt_symbianFbsClient()->lockHeap();
        else
        if (symbianVersion == QSysInfo::SV_9_2) {
            if (heapRefCount == 0)
                qt_symbianFbsClient()->lockHeap();
        } else {
            bitmap->LockHeap(ETrue);
        }
        heapRefCount++;
    }
    inline void endDataAccess(CFbsBitmap *bitmap)
    {
        heapRefCount--;
        if (symbianVersion == QSysInfo::SV_9_2) {
            if (!heapWasLocked)
            if (heapRefCount == 0)
                qt_symbianFbsClient()->unlockHeap();
        } else {
            bitmap->UnlockHeap(ETrue);
    }
};
int QSymbianBitmapDataAccess::heapRefCount = 0;
#define UPDATE_BUFFER()     \
    {                       \

Archive Download the corresponding diff file