src/hbservers/hbthemeserver/hbicondatacache_p.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
--- a/src/hbservers/hbthemeserver/hbicondatacache_p.cpp	Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbservers/hbthemeserver/hbicondatacache_p.cpp	Mon Oct 04 00:38:12 2010 +0300
@@ -223,19 +223,11 @@
         bool isMultiIconPiece)
 {
     HbIconCacheItem *item = 0;
-
     if (!cache->contains(key)) {
         return 0;
     }
     // Get the cache item associated with the key
-    item = (*cache)[(key)];
-    
-    if ((item->vectorIconData.type == INVALID_FORMAT) &&
-            (item->rasterIconData.type == INVALID_FORMAT)) {
-                cache->remove(key);
-                delete item;
-                return 0;
-    }
+    item = (*cache)[key];
 
 //Debug Code for Test Purpose
 #ifdef HB_ICON_CACHE_DEBUG
@@ -378,7 +370,8 @@
                 currentCpuCacheSize += item->rasterIconDataCost;
             }
         }
-        if (item->vectorIconData.type != INVALID_FORMAT) {
+        if (item->vectorIconData.type != INVALID_FORMAT
+            || item->blobIconData.type != INVALID_FORMAT) {
             // Increment the CPU cache size
             if (item->vectorIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize)) {
                 currentCpuCacheSize += item->vectorIconDataCost;
@@ -497,7 +490,8 @@
         }
 #endif
 
-        if ((item->vectorIconData.type != INVALID_FORMAT) &&  item->refCount == 0) {
+        if (item->vectorIconData.type != INVALID_FORMAT 
+            && item->blobIconData.type != INVALID_FORMAT) {
 
             //Debug Code for Test Purpose
 #ifdef HB_ICON_CACHE_DEBUG
@@ -659,7 +653,8 @@
                                                  + cpuLruListSize);
         }
     }
-    if (item->vectorIconData.type != INVALID_FORMAT) {
+    if (item->vectorIconData.type != INVALID_FORMAT
+        || item->blobIconData.type != INVALID_FORMAT) {
         if (item->vectorIconDataCost <= 0 || item->vectorIconDataCost > maxCpuCacheLimit) {
             return false;
         }
@@ -963,6 +958,7 @@
         manager->free(releaseItem->vectorIconData.nvgData.offset);
     } else if (releaseItem->blobIconData.type == BLOB) {
         manager->free(releaseItem->blobIconData.blobData.offset);
+        releaseItem->blobIconData.type = INVALID_FORMAT;
     }
     releaseItem->vectorIconData.type = INVALID_FORMAT;
     releaseItem->cpuLink.setNext(0);