summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-13 14:42:23 -0600
committerJosé Fonseca <jfonseca@vmware.com>2011-07-11 20:03:35 +0100
commitc4c41be7ef89e679013a800fb077fef773dc2280 (patch)
tree10a58d6f527340eb3fc335d04c187deeea10a146
parent03f7d5143610ce173a417c7eb47092d10e6b6836 (diff)
downloadglut-c4c41be7ef89e679013a800fb077fef773dc2280.tar.gz
Fix timer problem when using Fortran bindings (submitted by Bill Mitchell)
Also, add some comments about what's going on.
-rw-r--r--src/glut/glx/glut_event.c6
1 files changed, 5 insertions, 1 deletions
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;
}