From 94d2478d114ec78ff03eb4fb1bd6c6004efd409b Mon Sep 17 00:00:00 2001 From: tasn Date: Sun, 3 Jun 2012 13:33:09 +0000 Subject: [PATCH] Eo: Added a flag to know if we have any callbacks to clear. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/PROTO/eobj@71663 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- lib/eo_base_class.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/eo_base_class.c b/lib/eo_base_class.c index 1559968..297440b 100644 --- a/lib/eo_base_class.c +++ b/lib/eo_base_class.c @@ -15,6 +15,7 @@ typedef struct Eina_Inlist *callbacks; int walking_list; int event_freeze_count; + Eina_Bool deletions_waiting : 1; } Private_Data; typedef struct @@ -271,6 +272,12 @@ _eo_callbacks_clear(Private_Data *pd) if (pd->walking_list > 0) return; + /* If there are no deletions waiting. */ + if (!pd->deletions_waiting) + return; + + pd->deletions_waiting = EINA_FALSE; + EINA_INLIST_FOREACH_SAFE(pd->callbacks, itn, cb) { if (cb->delete_me) @@ -327,6 +334,7 @@ _ev_cb_del(Eo *obj, void *class_data, va_list *list) (cb->func_data == user_data)) { cb->delete_me = EINA_TRUE; + pd->deletions_waiting = EINA_TRUE; _eo_callbacks_clear(pd); eo_do(obj, eo_event_callback_call(EO_EV_CALLBACK_DEL, desc, NULL)); return; -- 2.7.4