diff --git a/src/lib/eo/eo_base_class.c b/src/lib/eo/eo_base_class.c index bd394910c9..e7445021bd 100644 --- a/src/lib/eo/eo_base_class.c +++ b/src/lib/eo/eo_base_class.c @@ -2146,7 +2146,9 @@ restart_back: end: // Handling restarting list walking complete exit. - if (restart_lookup) restart_lookup->idx = 0; + // This must be 1, we copy back the frame idx at the end of the for loop. + // The next iteration then decrements the idx by 1 which results in the effective running idx of that frame beeing 0 + if (restart_lookup) restart_lookup->idx = 1; EVENT_STACK_POP(pd); diff --git a/src/tests/eo/signals/signals_main.c b/src/tests/eo/signals/signals_main.c index c3b1648c17..859e145ecb 100644 --- a/src/tests/eo/signals/signals_main.c +++ b/src/tests/eo/signals/signals_main.c @@ -74,6 +74,22 @@ _restart_3_cb(void *data, const Efl_Event *event) called++; } +static void +_restart_3_no_stop_cb(void *data, const Efl_Event *event) +{ + fprintf(stderr, "restart 3 no stop inside: %i\n", inside); + fprintf(stderr, "restart 3 no stop exit inside: %i (%i)\n", inside, called); + + if (!inside) + { + inside = EINA_TRUE; + efl_event_callback_call(event->object, event->desc, data); + inside = EINA_FALSE; + } + + called++; +} + int main(int argc, char *argv[]) { @@ -219,8 +235,21 @@ main(int argc, char *argv[]) efl_event_callback_legacy_call(obj, EV_RESTART, NULL); fail_if(inside); fail_if(called != 3); - efl_unref(obj); + + pd = NULL; + inside = EINA_FALSE; + called = 0; + + obj = efl_add_ref(SIMPLE_CLASS, NULL); + efl_event_callback_add(obj, EV_RESTART, _restart_3_no_stop_cb, NULL); + efl_event_callback_add(obj, EV_RESTART, _null_cb, NULL); + efl_event_callback_add(obj, EV_RESTART, _restart_3_no_stop_cb, NULL); + efl_event_callback_call(obj, EV_RESTART, NULL); + fail_if(inside); + fail_if(called != 2); + + efl_object_shutdown(); return 0; }