From: Tom Hacohen Date: Mon, 9 Nov 2015 14:06:39 +0000 (+0000) Subject: Revert "Eo: Optimise event callback call" X-Git-Tag: upstream/1.20.0~8318 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e992a3a1e0b597fecbe4b935659138d6a9bafcf2;p=platform%2Fupstream%2Fefl.git Revert "Eo: Optimise event callback call" This reverts commit 4b116627c24a43248abf5a34a391241b1c0cf983. This can't be done, because the freeze state can change from within the callbacks so you need to check if events are frozen every time. --- diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index daf7a9d..f99ca37 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -671,45 +671,48 @@ _eo_base_event_callback_call(Eo *obj_id, Eo_Base_Data *pd, pd->walking_list++; - if (!desc->unfreezable && (event_freeze_count || pd->event_freeze_count)) - goto end; - for (cb = pd->callbacks; cb; cb = cb->next) { - if (cb->delete_me) - continue; - - if (cb->func_array) + if (!cb->delete_me) { - const Eo_Callback_Array_Item *it; + if (cb->func_array) + { + const Eo_Callback_Array_Item *it; - for (it = cb->items.item_array; it->func; it++) + for (it = cb->items.item_array; it->func; it++) + { + if (!_cb_desc_match(it->desc, desc)) + continue; + if (!it->desc->unfreezable && + (event_freeze_count || pd->event_freeze_count)) + continue; + + /* Abort callback calling if the func says so. */ + if (!it->func((void *) cb->func_data, obj_id, desc, + (void *) event_info)) + { + ret = EINA_FALSE; + goto end; + } + } + } + else { - if (!_cb_desc_match(it->desc, desc)) + if (!_cb_desc_match(cb->items.item.desc, desc)) + continue; + if (!cb->items.item.desc->unfreezable && + (event_freeze_count || pd->event_freeze_count)) continue; /* Abort callback calling if the func says so. */ - if (!it->func((void *) cb->func_data, obj_id, desc, - (void *) event_info)) + if (!cb->items.item.func((void *) cb->func_data, obj_id, desc, + (void *) event_info)) { ret = EINA_FALSE; goto end; } } } - else - { - if (!_cb_desc_match(cb->items.item.desc, desc)) - continue; - - /* Abort callback calling if the func says so. */ - if (!cb->items.item.func((void *) cb->func_data, obj_id, desc, - (void *) event_info)) - { - ret = EINA_FALSE; - goto end; - } - } } end: