diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index fa5222d888..1743695019 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -488,8 +488,9 @@ _eo_base_parent_set(Eo *obj, Eo_Base_Data *pd, Eo *parent_id) pd->parent, obj); } - /* Only unref if we don't have a new parent instead. */ - if (!parent_id) + /* Only unref if we don't have a new parent instead and we are not at + * the process of deleting the object.*/ + if (!parent_id && !eo_obj->del_triggered) { _eo_unref(eo_obj); } @@ -1432,8 +1433,6 @@ _eo_base_destructor(Eo *obj, Eo_Base_Data *pd) if (pd->parent) { - /* A bit ugly, but unparent unrefs, so we need to ref before. */ - eo_ref(obj); eo_parent_set(obj, NULL); } diff --git a/src/lib/eo/eo_private.h b/src/lib/eo/eo_private.h index dd5176cb2e..3cba394896 100644 --- a/src/lib/eo/eo_private.h +++ b/src/lib/eo/eo_private.h @@ -332,8 +332,6 @@ _eo_unref(_Eo_Object *obj) obj->del_triggered = EINA_TRUE; _eo_del_internal(__FILE__, __LINE__, obj); - - obj->del_triggered = EINA_FALSE; #ifdef EO_DEBUG /* If for some reason it's not empty, clear it. */ while (obj->xrefs)