tasn pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=104a57b58ab44449bd015ca677a225cee4cb92cf

commit 104a57b58ab44449bd015ca677a225cee4cb92cf
Author: Tom Hacohen <[email protected]>
Date:   Mon Sep 30 14:16:46 2013 +0100

    Eo callbacks: Fix a possible issue of corrupted callback list.
    
    This happens when we delete more than one callback at the beginning
    of the list (i.e 2 or more) in one go.
---
 src/lib/eo/eo_base_class.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 98a6a0d..a5a7c62 100644
--- a/src/lib/eo/eo_base_class.c
+++ b/src/lib/eo/eo_base_class.c
@@ -425,8 +425,6 @@ _eo_callback_remove(Private_Data *pd, 
Eo_Callback_Description *cb)
    Eo_Callback_Description *itr, *pitr = NULL;
 
    itr = pd->callbacks;
-   if (pd->callbacks == cb)
-      pd->callbacks = cb->next;
 
    for ( ; itr ; )
      {
@@ -439,6 +437,10 @@ _eo_callback_remove(Private_Data *pd, 
Eo_Callback_Description *cb)
                {
                   pitr->next = titr->next;
                }
+             else
+               {
+                  pd->callbacks = titr->next;
+               }
              free(titr);
           }
         else

-- 


Reply via email to