summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-07-19 14:44:26 (GMT)
committerToby Tomkins <toby.tomkins@nokia.com>2010-07-21 06:08:04 (GMT)
commitcec1dda330bff7203c128eafb109f4f804897610 (patch)
treed2ae6a2b8e3a44a90d4ab95f6c407538d8fb8928 /src/gui
parent9d11514cd9a07489b704615e7a8cf41a43a4598d (diff)
downloadQt-cec1dda330bff7203c128eafb109f4f804897610.zip
Qt-cec1dda330bff7203c128eafb109f4f804897610.tar.gz
Qt-cec1dda330bff7203c128eafb109f4f804897610.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. (cherry picked from commit d4cc1dcea5b4116767cfee0ec45bfba72dc011ff)
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qpixmap_s60.cpp20
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() \
{ \