summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-31 15:07:28 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-31 15:07:28 +0900
commitc5a5302e069ad1e624319ca17c17ecfb8634c9c6 (patch)
treeba79c48e675d88148765d05cb7ce27c095f44d85
parent968e1dfb3728a9d630fd5596484f1973ae997ca1 (diff)
evas - handle devices that on deletion delete other devices on shutdown
this fixes a whole bunch of warnings that just recently turned up...
-rw-r--r--src/lib/evas/canvas/evas_device.c12
-rw-r--r--src/lib/evas/include/evas_private.h1
2 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_device.c b/src/lib/evas/canvas/evas_device.c
index d352b3c69f..7f93b77801 100644
--- a/src/lib/evas/canvas/evas_device.c
+++ b/src/lib/evas/canvas/evas_device.c
@@ -78,6 +78,7 @@ _del_cb(void *data, const Efl_Event *ev)
78{ 78{
79 Evas_Public_Data *e = data; 79 Evas_Public_Data *e = data;
80 80
81 e->devices_modified = EINA_TRUE;
81 // can not be done in std destructor 82 // can not be done in std destructor
82 e->devices = eina_list_remove(e->devices, ev->object); 83 e->devices = eina_list_remove(e->devices, ev->object);
83 84
@@ -473,9 +474,18 @@ _evas_device_cleanup(Evas *eo_e)
473 474
474 /* If the device is deleted, _del_cb will remove the device 475 /* If the device is deleted, _del_cb will remove the device
475 from the devices list. */ 476 from the devices list. */
477again:
478 e->devices_modified = EINA_FALSE;
476 cpy = eina_list_clone(e->devices); 479 cpy = eina_list_clone(e->devices);
477 EINA_LIST_FREE(cpy, dev) 480 EINA_LIST_FREE(cpy, dev)
478 evas_device_del(dev); 481 {
482 evas_device_del(dev);
483 if (e->devices_modified)
484 {
485 eina_list_free(cpy);
486 goto again;
487 }
488 }
479 489
480 /* Not all devices were deleted. The user probably will unref them later. 490 /* Not all devices were deleted. The user probably will unref them later.
481 Since Evas will be deleted, remove the del callback from them and 491 Since Evas will be deleted, remove the del callback from them and
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index f055bc09c6..3124f83c5c 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -977,6 +977,7 @@ struct _Evas_Public_Data
977 Eina_Bool render2 : 1; 977 Eina_Bool render2 : 1;
978 Eina_Bool common_init : 1; 978 Eina_Bool common_init : 1;
979 Eina_Bool inside_post_render : 1; 979 Eina_Bool inside_post_render : 1;
980 Eina_Bool devices_modified : 1;
980}; 981};
981 982
982struct _Evas_Layer 983struct _Evas_Layer