From 63c94dfc6da0dc026266ad41d67fc0c78cf1667a Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 18 Nov 2009 16:32:09 -0500 Subject: [PATCH] [event-loop] Restart front of pending timeout list after dispatch This is in case a timeout handler invalidates the list while being dispatched. --- src/libply/ply-event-loop.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libply/ply-event-loop.c b/src/libply/ply-event-loop.c index 476b116f..dacf1007 100644 --- a/src/libply/ply-event-loop.c +++ b/src/libply/ply-event-loop.c @@ -1201,6 +1201,10 @@ ply_event_loop_handle_timeouts (ply_event_loop_t *loop) watch->handler (watch->user_data, loop); free (watch); + + /* start over in case the handler invalidated the list + */ + next_node = ply_list_get_first_node (loop->timeout_watches); } else {