summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2015-04-30 17:12:55 +0200
committerCedric BAIL <cedric@osg.samsung.com>2015-05-05 10:17:00 +0200
commit28e66c23b66b5367232fff55eb4422559dbf11b5 (patch)
tree73b32266db5e56dc4c35539b74585053d352cae4 /src/modules
parentcb6f13eb6f3b38382aa00842fc83ae88f89b272b (diff)
evas: prevent infinite loop when there is no image we can remove.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index d9e8c4b..09d999b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -55,6 +55,7 @@ _evas_gl_image_cache_trim(Evas_Engine_GL_Context *gc)
55 { 55 {
56 Evas_GL_Image *im2; 56 Evas_GL_Image *im2;
57 Eina_List *l = NULL; 57 Eina_List *l = NULL;
58 Eina_Bool removed = EINA_FALSE;
58 59
59 EINA_LIST_REVERSE_FOREACH(gc->shared->images, l, im2) 60 EINA_LIST_REVERSE_FOREACH(gc->shared->images, l, im2)
60 { 61 {
@@ -66,11 +67,14 @@ _evas_gl_image_cache_trim(Evas_Engine_GL_Context *gc)
66 im2->gc->shared->images_size -= (im2->csize); 67 im2->gc->shared->images_size -= (im2->csize);
67 evas_gl_common_image_free(im2); 68 evas_gl_common_image_free(im2);
68 l = NULL; 69 l = NULL;
70 removed = EINA_TRUE;
69 break; 71 break;
70 } 72 }
71 } 73 }
72 if (!gc->shared->images) 74
75 if (!removed || !gc->shared->images)
73 { 76 {
77 ERR("Preventing infinite loop.");
74// printf("EEK %i > %i, no imgs\n", 78// printf("EEK %i > %i, no imgs\n",
75// gc->shared->images_size, size); 79// gc->shared->images_size, size);
76 break; 80 break;