evas_device_del does eina_list_remove, and EINA_LIST_FREE does the same thing.
It can causes memory leak and possible crash. (reported by valgrind)
Signed-off-by: Duna Oh <duna.oh@samsung.com>
Change-Id: I2166f1eb4672ffe65dd961d608557018ade1cae0
_evas_device_cleanup(Evas *eo_e)
{
Evas_Device *dev;
+ Eina_List *l1, *l2;
Evas_Public_Data *e = eo_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
if (e->cur_device)
eina_array_free(e->cur_device);
e->cur_device = NULL;
}
- EINA_LIST_FREE(e->devices, dev)
+ EINA_LIST_FOREACH_SAFE(e->devices, l1, l2, dev)
{
- evas_device_del(dev);
+ while (dev)
+ evas_device_del(dev);
}
}