Eo: Check adding/deleting callbacks from within callbacks doesn't crash.

SVN revision: 71745
This commit is contained in:
Tom Hacohen 2012-06-06 11:41:51 +00:00
parent 143e06b209
commit 1754ca9608
1 changed files with 13 additions and 0 deletions

View File

@ -5,6 +5,16 @@
static int cb_count = 0;
static Eina_Bool
_null_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
{
(void) desc;
(void) obj;
(void) data;
(void) event_info;
return EO_CALLBACK_CONTINUE;
}
static Eina_Bool
_a_changed_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info)
{
@ -15,6 +25,9 @@ _a_changed_cb(void *data, Eo *obj, const Eo_Event_Description *desc, void *event
cb_count++;
eo_do(obj, eo_event_callback_priority_add(EV_A_CHANGED, EO_CALLBACK_PRIORITY_BEFORE, _null_cb, (void *) 23423));
eo_do(obj, eo_event_callback_del(EV_A_CHANGED, _null_cb, (void *) 23423));
/* Stop as we reached the 3rd one. */
return (cb_count != 3);
}