evas - handle devices that on deletion delete other devices on shutdown

this fixes a whole bunch of warnings that just recently turned up...
This commit is contained in:
Carsten Haitzler 2017-07-31 15:07:28 +09:00
parent 968e1dfb37
commit c5a5302e06
2 changed files with 12 additions and 1 deletions

View File

@ -78,6 +78,7 @@ _del_cb(void *data, const Efl_Event *ev)
{
Evas_Public_Data *e = data;
e->devices_modified = EINA_TRUE;
// can not be done in std destructor
e->devices = eina_list_remove(e->devices, ev->object);
@ -473,9 +474,18 @@ _evas_device_cleanup(Evas *eo_e)
/* If the device is deleted, _del_cb will remove the device
from the devices list. */
again:
e->devices_modified = EINA_FALSE;
cpy = eina_list_clone(e->devices);
EINA_LIST_FREE(cpy, dev)
evas_device_del(dev);
{
evas_device_del(dev);
if (e->devices_modified)
{
eina_list_free(cpy);
goto again;
}
}
/* Not all devices were deleted. The user probably will unref them later.
Since Evas will be deleted, remove the del callback from them and

View File

@ -977,6 +977,7 @@ struct _Evas_Public_Data
Eina_Bool render2 : 1;
Eina_Bool common_init : 1;
Eina_Bool inside_post_render : 1;
Eina_Bool devices_modified : 1;
};
struct _Evas_Layer