forked from enlightenment/efl
Evas filters: Avoid potential memory leaks
Properly free the buffers when they are not in the current context list.
This commit is contained in:
parent
6d4dd3f194
commit
c783b8d450
|
@ -113,8 +113,11 @@ _filter_buffer_backing_free(Evas_Filter_Buffer *fb)
|
||||||
|
|
||||||
if (fb->stolen)
|
if (fb->stolen)
|
||||||
{
|
{
|
||||||
fb->delete_me = EINA_TRUE;
|
if (eina_list_data_find(fb->ctx->buffers, fb))
|
||||||
return;
|
{
|
||||||
|
fb->delete_me = EINA_TRUE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
INF("Free backing of buffer %d fb @ %p backing @ %p alloc %d", fb->id, fb, fb->backing, fb->allocated);
|
INF("Free backing of buffer %d fb @ %p backing @ %p alloc %d", fb->id, fb, fb->backing, fb->allocated);
|
||||||
|
@ -671,6 +674,7 @@ evas_filter_buffer_backing_release(Evas_Filter_Context *ctx, void *stolen_buffer
|
||||||
fb->stolen = EINA_FALSE;
|
fb->stolen = EINA_FALSE;
|
||||||
if (fb->delete_me)
|
if (fb->delete_me)
|
||||||
{
|
{
|
||||||
|
ctx->buffers = eina_list_remove_list(ctx->buffers, li);
|
||||||
ENFN->image_free(ENDT, stolen_buffer);
|
ENFN->image_free(ENDT, stolen_buffer);
|
||||||
free(fb);
|
free(fb);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue