summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/evas/cache/evas_cache_image.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c
index f52e12a..c31be5b 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -168,8 +168,6 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
168{ 168{
169 if (!ie) return; 169 if (!ie) return;
170 if (!ie->cache) return; 170 if (!ie->cache) return;
171//// SLKL(ie->lock);
172//// SLKU(ie->lock);
173 if ((cache) && (cache->func.debug)) cache->func.debug("deleting", ie); 171 if ((cache) && (cache->func.debug)) cache->func.debug("deleting", ie);
174 if (ie->flags.delete_me == 1) return; 172 if (ie->flags.delete_me == 1) return;
175 if (ie->preload) 173 if (ie->preload)
@@ -480,7 +478,11 @@ _evas_cache_image_entry_preload_add(Image_Entry *ie, const Eo *target, void (*pr
480 } 478 }
481 479
482 tg = calloc(1, sizeof(Evas_Cache_Target)); 480 tg = calloc(1, sizeof(Evas_Cache_Target));
483 if (!tg) return 0; 481 if (!tg)
482 {
483 evas_cache_image_drop(ie);
484 return 0;
485 }
484 tg->target = target; 486 tg->target = target;
485 tg->preloaded_cb = preloaded_cb; 487 tg->preloaded_cb = preloaded_cb;
486 tg->preloaded_data = preloaded_data; 488 tg->preloaded_data = preloaded_data;
@@ -826,9 +828,7 @@ evas_cache_image_mmap_request(Evas_Cache_Image *cache,
826 828
827 on_ok: 829 on_ok:
828 *error = EVAS_LOAD_ERROR_NONE; 830 *error = EVAS_LOAD_ERROR_NONE;
829//// SLKL(im->lock);
830 im->references++; 831 im->references++;
831//// SLKU(im->lock);
832 SLKU(engine_lock); 832 SLKU(engine_lock);
833 return im; 833 return im;
834} 834}
@@ -837,9 +837,7 @@ EAPI void
837evas_cache_image_ref(Image_Entry *im) 837evas_cache_image_ref(Image_Entry *im)
838{ 838{
839 SLKL(engine_lock); 839 SLKL(engine_lock);
840//// SLKL(im->lock);
841 im->references++; 840 im->references++;
842//// SLKU(im->lock);
843 SLKU(engine_lock); 841 SLKU(engine_lock);
844} 842}
845 843
@@ -851,11 +849,9 @@ evas_cache_image_drop(Image_Entry *im)
851 849
852 if (!im->cache) return; 850 if (!im->cache) return;
853 SLKL(engine_lock); 851 SLKL(engine_lock);
854//// SLKL(im->lock);
855 im->references--; 852 im->references--;
856 if (im->references < 0) im->references = 0; 853 if (im->references < 0) im->references = 0;
857 references = im->references; 854 references = im->references;
858//// SLKU(im->lock);
859 SLKU(engine_lock); 855 SLKU(engine_lock);
860 856
861 cache = im->cache; 857 cache = im->cache;
@@ -864,7 +860,9 @@ evas_cache_image_drop(Image_Entry *im)
864 { 860 {
865 if (im->preload) 861 if (im->preload)
866 { 862 {
863 SLKL(engine_lock);
867 _evas_cache_image_entry_preload_remove(im, NULL, EINA_TRUE); 864 _evas_cache_image_entry_preload_remove(im, NULL, EINA_TRUE);
865 SLKU(engine_lock);
868 return; 866 return;
869 } 867 }
870 if ((im->flags.dirty) || (im->load_failed)) 868 if ((im->flags.dirty) || (im->load_failed))
@@ -1089,7 +1087,6 @@ evas_cache_image_size_set(Image_Entry *im, unsigned int w, unsigned int h)
1089 if (error != 0) goto on_error; 1087 if (error != 0) goto on_error;
1090 im2->references = 1; 1088 im2->references = 1;
1091 im2->flags.loaded = EINA_TRUE; 1089 im2->flags.loaded = EINA_TRUE;
1092 evas_cache_image_drop(im);
1093 if (cache->func.debug) cache->func.debug("size_set", im2); 1090 if (cache->func.debug) cache->func.debug("size_set", im2);
1094 evas_cache_image_drop(im); 1091 evas_cache_image_drop(im);
1095 return im2; 1092 return im2;
@@ -1099,7 +1096,6 @@ on_error:
1099 if (im2) _evas_cache_image_entry_delete(cache, im2); 1096 if (im2) _evas_cache_image_entry_delete(cache, im2);
1100 SLKU(engine_lock); 1097 SLKU(engine_lock);
1101 evas_cache_image_drop(im); 1098 evas_cache_image_drop(im);
1102 evas_cache_image_drop(im);
1103 return NULL; 1099 return NULL;
1104} 1100}
1105 1101