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 {