summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2015-09-26 22:37:03 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2015-09-26 22:37:03 +0300
commit08e4f0ce8d5c08f8e73ce83532bcba275b2e9a74 (patch)
tree1f61203d05648af539b33e0b77a8d0a4f45e5aaf /src
parentb20910087000e6c6f6ae8056b5cdea26398f133b (diff)
Eo: fix double callback deletion
Scenario: - Same signal/function/data registered twice on e.g mouse_down - On mouse_down, register mouse_move and mouse_up - On mouse_up, unregister mouse_move Result: mouse_move still invoked after mouse_up Reason: - When the mouse_move callback deletion is required, the cb is flagged as deleted but is not freed as walking_list blocks. - When the second (and same) has to be deleted, it will try to delete the first again because the delete_me flag is not checked. This patch fixes it by checking the delete_me flag when determining the candidate. @fix
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/eo_base_class.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 77a4bf1005..bb0187790c 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -576,8 +576,8 @@ _eo_base_event_callback_del(Eo *obj, Eo_Base_Data *pd,
576 576
577 for (cb = pd->callbacks; cb; cb = cb->next) 577 for (cb = pd->callbacks; cb; cb = cb->next)
578 { 578 {
579 if ((cb->items.item.desc == desc) && (cb->items.item.func == func) && 579 if (!cb->delete_me && (cb->items.item.desc == desc) &&
580 (cb->func_data == user_data)) 580 (cb->items.item.func == func) && (cb->func_data == user_data))
581 { 581 {
582 const Eo_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}}; 582 const Eo_Callback_Array_Item arr[] = { {desc, func}, {NULL, NULL}};
583 583
@@ -622,7 +622,8 @@ _eo_base_event_callback_array_del(Eo *obj, Eo_Base_Data *pd,
622 622
623 for (cb = pd->callbacks; cb; cb = cb->next) 623 for (cb = pd->callbacks; cb; cb = cb->next)
624 { 624 {
625 if ((cb->items.item_array == array) && (cb->func_data == user_data)) 625 if (!cb->delete_me &&
626 (cb->items.item_array == array) && (cb->func_data == user_data))
626 { 627 {
627 cb->delete_me = EINA_TRUE; 628 cb->delete_me = EINA_TRUE;
628 pd->deletions_waiting = EINA_TRUE; 629 pd->deletions_waiting = EINA_TRUE;