diff options
Diffstat (limited to 'src/glut/glx/glut_event.c')
-rw-r--r-- | src/glut/glx/glut_event.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c index 4e67da674e..b5df7b2311 100644 --- a/src/glut/glx/glut_event.c +++ b/src/glut/glx/glut_event.c @@ -24,7 +24,7 @@ # ifdef __sgi # include <bstring.h> /* prototype for bzero used by FD_ZERO */ # endif -# if (defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) +# if (defined(__FreeBSD__) || defined(SVR4) || defined(CRAY) || defined(AIXV3)) && !defined(FD_SETSIZE) # include <sys/select.h> /* select system call interface */ # ifdef luna # include <sysent.h> @@ -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; } |