summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo_base_class.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-01 14:23:04 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:18 -0700
commitbb66aa37cab7982c456bc74580c24cf08e9f7ea7 (patch)
treee3f54bb72dd9e879ea8c4142094348920cc045cf /src/lib/eo/eo_base_class.c
parent93893def9f675840e6f38785eaa2067c1119684a (diff)
eo: preventing infinite loop by safely iterating over children during destructor.
Differential Revision: https://phab.enlightenment.org/D6078
Diffstat (limited to 'src/lib/eo/eo_base_class.c')
-rw-r--r--src/lib/eo/eo_base_class.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 963564a..56ebf42 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -2101,7 +2101,8 @@ _efl_object_constructor(Eo *obj, Efl_Object_Data *pd EINA_UNUSED)
2101EOLIAN static void 2101EOLIAN static void
2102_efl_object_destructor(Eo *obj, Efl_Object_Data *pd) 2102_efl_object_destructor(Eo *obj, Efl_Object_Data *pd)
2103{ 2103{
2104 Eo *child; 2104 _Eo_Object *obj_child;
2105 Eina_Inlist *l;
2105 Efl_Object_Extension *ext; 2106 Efl_Object_Extension *ext;
2106 _Eo_Object *obj_data2 = NULL; 2107 _Eo_Object *obj_data2 = NULL;
2107 2108
@@ -2165,9 +2166,11 @@ err_parent_back:
2165 return; 2166 return;
2166 2167
2167children: 2168children:
2168 while (pd->children) 2169 EINA_INLIST_FOREACH_SAFE(pd->children, l, obj_child)
2169 { 2170 {
2170 child = _eo_obj_id_get(EINA_INLIST_CONTAINER_GET(pd->children, _Eo_Object)); 2171 Eo *child;
2172
2173 child = _eo_obj_id_get(obj_child);
2171 efl_parent_set(child, NULL); 2174 efl_parent_set(child, NULL);
2172 } 2175 }
2173 goto children_back; 2176 goto children_back;