summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2013-09-30 14:16:46 +0100
committerTom Hacohen <tom@stosb.com>2013-09-30 14:16:46 +0100
commit104a57b58ab44449bd015ca677a225cee4cb92cf (patch)
tree085d22f56cb795043d9252b1b8510f9148689c13 /src
parentf5d4a807c845f37f502882858a61ea018557365a (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/lib/eo/eo_base_class.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c
index 98a6a0d430..a5a7c62f29 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)
425 Eo_Callback_Description *itr, *pitr = NULL; 425 Eo_Callback_Description *itr, *pitr = NULL;
426 426
427 itr = pd->callbacks; 427 itr = pd->callbacks;
428 if (pd->callbacks == cb)
429 pd->callbacks = cb->next;
430 428
431 for ( ; itr ; ) 429 for ( ; itr ; )
432 { 430 {
@@ -439,6 +437,10 @@ _eo_callback_remove(Private_Data *pd, Eo_Callback_Description *cb)
439 { 437 {
440 pitr->next = titr->next; 438 pitr->next = titr->next;
441 } 439 }
440 else
441 {
442 pd->callbacks = titr->next;
443 }
442 free(titr); 444 free(titr);
443 } 445 }
444 else 446 else