summaryrefslogtreecommitdiff
path: root/src/lib/eo/eo_base_class.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2018-05-01 16:27:46 -0700
committerCedric BAIL <cedric@osg.samsung.com>2018-05-24 16:02:18 -0700
commitef6cac1476e4722b75e2bee82cd83e05b859a92c (patch)
treef6902c317ee9af1ca18e6c71e4383ea66bd757e7 /src/lib/eo/eo_base_class.c
parent546a4c79e070225754c3cead52fd8127797cffb3 (diff)
eo: prevent parenting to an already invalidated parent.
Differential Revision: https://phab.enlightenment.org/D6086
Diffstat (limited to 'src/lib/eo/eo_base_class.c')
-rw-r--r--src/lib/eo/eo_base_class.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 2c8af23..631bef0 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -678,10 +678,21 @@ EOLIAN static void
678_efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id) 678_efl_object_parent_set(Eo *obj, Efl_Object_Data *pd, Eo *parent_id)
679{ 679{
680 Eo *prev_parent = pd->parent; 680 Eo *prev_parent = pd->parent;
681 Eina_Bool bad_parent = EINA_FALSE;
682
681 if ((pd->parent == parent_id) || 683 if ((pd->parent == parent_id) ||
682 ((parent_id) && (!_eo_id_domain_compatible(parent_id, obj)))) 684 ((parent_id) && (!_eo_id_domain_compatible(parent_id, obj))))
683 return; 685 return;
684 686
687 if (parent_id != NULL)
688 {
689 EO_OBJ_POINTER_GOTO(parent_id, parent_obj, err_impossible);
690 bad_parent = parent_obj->invalidate || parent_obj->is_invalidating;
691 EO_OBJ_DONE(parent_id);
692 }
693
694 if (bad_parent) goto err_parent;
695
685 EO_OBJ_POINTER_GOTO(obj, eo_obj, err_impossible); 696 EO_OBJ_POINTER_GOTO(obj, eo_obj, err_impossible);
686 697
687 if (eo_obj->is_invalidating && parent_id == NULL) 698 if (eo_obj->is_invalidating && parent_id == NULL)