diff options
author | axis <qt-info@nokia.com> | 2010-07-19 14:44:26 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2010-07-20 11:30:55 (GMT) |
commit | d4cc1dcea5b4116767cfee0ec45bfba72dc011ff (patch) | |
tree | 958b8a95c2f3c273eb4978a645a10ee54cf2b32e /src/gui/image | |
parent | cc4b3c0f9c66a586df67992f5b3687fbab4029d6 (diff) | |
download | Qt-d4cc1dcea5b4116767cfee0ec45bfba72dc011ff.zip Qt-d4cc1dcea5b4116767cfee0ec45bfba72dc011ff.tar.gz Qt-d4cc1dcea5b4116767cfee0ec45bfba72dc011ff.tar.bz2 |
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.
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap_s60.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gui/image/qpixmap_s60.cpp b/src/gui/image/qpixmap_s60.cpp index a13c8c8..9d571b5 100644 --- a/src/gui/image/qpixmap_s60.cpp +++ b/src/gui/image/qpixmap_s60.cpp @@ -157,10 +157,10 @@ class QSymbianBitmapDataAccess { public: - bool heapWasLocked; + static int heapRefCount; QSysInfo::SymbianVersion symbianVersion; - explicit QSymbianBitmapDataAccess() : heapWasLocked(false) + explicit QSymbianBitmapDataAccess() { symbianVersion = QSysInfo::symbianVersion(); }; @@ -169,16 +169,22 @@ public: 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); @@ -186,6 +192,8 @@ public: } }; +int QSymbianBitmapDataAccess::heapRefCount = 0; + #define UPDATE_BUFFER() \ { \ |