diff options
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() \ { \ |