Fixoring.

This commit is contained in:
Tom Hacohen 2014-09-30 14:27:43 +01:00
parent a4d716d1c0
commit 08ccaf5740
2 changed files with 8 additions and 11 deletions

View File

@ -1546,7 +1546,14 @@ eo_unref(const Eo *obj_id)
EAPI void
eo_del(const Eo *obj)
{
eo_unref(obj);
if (eo_do(obj, eo_parent_get()))
{
eo_do(obj, eo_parent_set(NULL));
}
else
{
eo_unref(obj);
}
}
EAPI int

View File

@ -284,16 +284,6 @@ _eo_unref(_Eo_Object *obj)
return;
}
/* Unparent if parented. */
{
Eo *eo_id = _eo_id_get(obj);
obj->refcount = 2; /* Needs to be high enough that parent set to null won't delete the object. */
eo_do(eo_id, eo_parent_set(NULL));
obj->refcount = 0;
}
_eo_del_internal(__FILE__, __LINE__, obj);
#ifdef EO_DEBUG