From 9072c9a37a9292990ec9120fe2f0cf06061f4aa1 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 30 Mar 2018 09:53:59 -0700 Subject: [PATCH] eo: add events when object get invalidated and loose all its reference matching other lifecycle events. --- src/lib/eo/efl_object.eo | 2 ++ src/lib/eo/eo_base_class.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 206d135524..249250d47b 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -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.]] diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index 183ed0e125..4dfde15370 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -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