efl_ui_table: remove inlist items in EINA_INLIST_FREE macro

Summary:
Check the EINA_INLIST_FREE document
```
in eina_inlist.h

NOTE: it is the duty of the body loop to properly remove the item from the
inlist and free it. This function will turn into a infinite loop if you
don't remove all items from the list.
```

This will avoid infinite loop when Efl.Ui.Table is invalidated.

ref T8145

Test Plan: See the test file in T8145

Reviewers: brunobelo, Jaehyun_Cho, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8145

Differential Revision: https://phab.enlightenment.org/D9699
This commit is contained in:
Yeongjong Lee 2019-08-23 13:22:33 -04:00 committed by Mike Blumenkrantz
parent e2b6e18577
commit b60e949fb6
1 changed files with 4 additions and 0 deletions

View File

@ -244,6 +244,10 @@ _efl_ui_table_efl_object_invalidate(Eo *obj, Efl_Ui_Table_Data *pd)
EINA_INLIST_FREE(EINA_INLIST_GET(pd->items), gi)
{
efl_event_callback_array_del(gi->object, efl_ui_table_callbacks(), obj);
pd->items = (Table_Item *)
eina_inlist_remove(EINA_INLIST_GET(pd->items), EINA_INLIST_GET(gi));
free(gi);
}
}