eo: add events when object get invalidated and loose all its reference matching other lifecycle events.

This commit is contained in:
Cedric BAIL 2018-03-30 09:53:59 -07:00
parent 79b283ab94
commit 9072c9a37a
2 changed files with 6 additions and 1 deletions

View File

@ -306,6 +306,8 @@ abstract Efl.Object ()
callback,add @hot; [[A callback was added.]]
callback,del @hot; [[A callback was deleted.]]
del @hot; [[Object is being deleted.]]
invalidate @hot; [[Object is being invalidated and loosing its parent.]]
noref @hot; [[Object has lost its last reference, only parent relationship is keeping it alive.]]
destruct @hot; [[Object has been fully destroyed. It can not be used
beyond this point. This event should only serve to clean up any
dangling pointer.]]

View File

@ -2173,14 +2173,17 @@ _efl_object_finalize(Eo *obj, Efl_Object_Data *pd EINA_UNUSED)
static void
_efl_object_invalidate(Eo *obj, Efl_Object_Data *pd)
{
efl_event_callback_call(obj, EFL_EVENT_INVALIDATE, NULL);
_efl_pending_futures_clear(pd);
efl_parent_set(obj, NULL);
pd->invalidate = EINA_TRUE;
}
static void
_efl_object_noref(Eo *obj EINA_UNUSED, Efl_Object_Data *pd EINA_UNUSED)
_efl_object_noref(Eo *obj, Efl_Object_Data *pd EINA_UNUSED)
{
efl_event_callback_call(obj, EFL_EVENT_NOREF, NULL);
}
EOLIAN static void