From d4cc1dcea5b4116767cfee0ec45bfba72dc011ff Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 19 Jul 2010 16:44:26 +0200 Subject: 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. --- src/gui/image/qpixmap_s60.cpp | 20 ++++++++++++++------ 1 file 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() \ { \ -- cgit v0.12 From a87ce3dd0d134b353ae76b031c1d1696ab7e522c Mon Sep 17 00:00:00 2001 From: axis Date: Mon, 19 Jul 2010 17:00:26 +0200 Subject: Fixed some deployment issues on Symbian. Both plugins should be part of the main package now. RevBy: Trust me --- tests/auto/qpixmap/qpixmap.pro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index c3ee192..082747b 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -13,13 +13,12 @@ wince*|symbian: { icons.path = convertFromToHICON DEPLOYMENT += task31722_0 task31722_1 icons - DEPLOYMENT_PLUGIN += qico } wince*: { DEFINES += SRCDIR=\\\".\\\" + DEPLOYMENT_PLUGIN += qico } else:symbian { - DEPLOYMENT_PLUGIN += qmng LIBS += -lfbscli.dll -lbitgdi.dll -lgdi.dll contains(QT_CONFIG, openvg) { LIBS += $$QMAKE_LIBS_OPENVG -- cgit v0.12 From 2feb893547a19534613c434fccbb0cdc8eba6cdb Mon Sep 17 00:00:00 2001 From: axis Date: Tue, 20 Jul 2010 13:24:07 +0200 Subject: Added missing deployment to autotest. RevBy: Trust me --- tests/auto/qpixmap/qpixmap.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/auto/qpixmap/qpixmap.pro b/tests/auto/qpixmap/qpixmap.pro index 082747b..ff8258f 100644 --- a/tests/auto/qpixmap/qpixmap.pro +++ b/tests/auto/qpixmap/qpixmap.pro @@ -12,7 +12,10 @@ wince*|symbian: { icons.sources = convertFromToHICON/* icons.path = convertFromToHICON - DEPLOYMENT += task31722_0 task31722_1 icons + loadFromData.sources = loadFromData/* + loadFromData.path = loadFromData + + DEPLOYMENT += task31722_0 task31722_1 icons loadFromData } wince*: { -- cgit v0.12