that's what I think should be the correct behaviour:
regular case :
o = eo_add(CLASS, NULL);
eo_unref(o);
// o is destroyed, you own it, you do what it pleases you with it.
but :
o = eo_add(CLASS, parent);
eo_unref(o);
// o still leaves, it is referenced by parent.
// you gave up working with it, as you wish,
// but parent still owns a reference to it.
moreover :
o = eo_add(CLASS, parent);
eo_unref(o);
eo_unref(o);
// ERROR msg and no destruction.
// you try to steal the ref you gave to the parent, that's bad behaviour.
the only right way to do so is :
o = eo_add(CLASS, parent);
eo_parent_set(o, NULL);
eo_unref(o);
// o is destroyed. no question asked.
there is always an exception :
o = eo_add(CLASS, parent);
eo_del(o);
// eo_del is powerfull, it first clears the ref owned by parent,
// then destroys o. You are still almighty.
--- Hell'O from Yverdoom
Jérémy (jeyzu)
------------------------------------------------------------------------------
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel