From c4c41be7ef89e679013a800fb077fef773dc2280 Mon Sep 17 00:00:00 2001 From: Brian Date: Thu, 13 Sep 2007 14:42:23 -0600 Subject: Fix timer problem when using Fortran bindings (submitted by Bill Mitchell) Also, add some comments about what's going on. --- src/glut/glx/glut_event.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index 0a96e8c..b5df7b2 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -172,10 +172,14 @@ handleTimeouts(void) GETTIMEOFDAY(&now); while (IS_AT_OR_AFTER(__glutTimerList->timeout, now)) { timer = __glutTimerList; - __glutTimerList = timer->next; + /* call the timer function */ timer->func(timer->value); + /* remove from the linked list */ + __glutTimerList = timer->next; + /* put this timer on the "free" list */ timer->next = freeTimerList; freeTimerList = timer; + if (!__glutTimerList) break; } -- cgit v1.2.1