Fix timer problem when using Fortran bindings (submitted by Bill Mitchell)
authorBrian <brian.paul@tungstengraphics.com>
Thu, 13 Sep 2007 20:42:23 +0000 (14:42 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 13 Sep 2007 20:42:23 +0000 (14:42 -0600)
Also, add some comments about what's going on.

src/glut/glx/glut_event.c

index 0a96e8cf71de932b5229a8051bd821c4aa511c0f..b5df7b23119d93c5f0416231d65e31dabe952aaf 100644 (file)
@@ -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;
   }