diff --git a/legacy/ecore/AUTHORS b/legacy/ecore/AUTHORS index f3ef950513..cb54c18bba 100644 --- a/legacy/ecore/AUTHORS +++ b/legacy/ecore/AUTHORS @@ -1,3 +1,4 @@ The Rasterman Tom Gilbert Burra +Chris Ross diff --git a/legacy/ecore/src/Ecore.h b/legacy/ecore/src/Ecore.h index 8b922e8807..cfc9346a50 100644 --- a/legacy/ecore/src/Ecore.h +++ b/legacy/ecore/src/Ecore.h @@ -732,6 +732,7 @@ void e_add_event_ipc(int ipc, void (*func) (int ipc)); void e_del_event_ipc(int ipc); void e_event_loop(void); +void e_event_loop_quit(void); void e_add_event_timer(char *name, double in, void (*func) (int val, void *data), diff --git a/legacy/ecore/src/e_ev_filter.c b/legacy/ecore/src/e_ev_filter.c index b00f44ac67..1411580ddb 100644 --- a/legacy/ecore/src/e_ev_filter.c +++ b/legacy/ecore/src/e_ev_filter.c @@ -94,11 +94,14 @@ e_event_filter_idle_handle(void) h->func(h->data); } +extern int __quit_ev_loop; + void e_event_filter_init(void) { int i; + __quit_ev_loop = 0; for (i = 0; i < EV_MAX; i++) handler[i] = NULL; } diff --git a/legacy/ecore/src/e_events.c b/legacy/ecore/src/e_events.c index d2fd49ed07..7859f70e16 100644 --- a/legacy/ecore/src/e_events.c +++ b/legacy/ecore/src/e_events.c @@ -14,6 +14,8 @@ Ev_Timer *timers = NULL; Eevent *events = NULL; Eevent *last_event = NULL; +int __quit_ev_loop = 0; + /* local functions for event handling */ static void e_handle_event_timer(void); static void e_handle_zero_event_timer(void); @@ -177,7 +179,7 @@ e_event_loop(void) time1 = e_get_time(); time2 = time1 - prev_time; prev_time = time1; - for (;;) + while( __quit_ev_loop == 0 ) { /* state setup */ timed_out = 0; @@ -313,6 +315,14 @@ e_event_loop(void) } } +/* set a flag to 0 so that we can quit the event loop and shutdown + * properly */ +void +e_event_loop_quit(void) +{ + __quit_ev_loop = 1; +} + /* add a timeout funcitont o be called in "in" seconds with name name */ void e_add_event_timer(char *name, double in, void (*func) (int val, void *data),