>The function fgCloseWindows is used at the end
>> of each pass of glutMainLoopEvent to destroy
>> all the windows in the WindowsToDestroy list
>> to avoid destroying windows while their
>> callback handlers are still executing.
>> However, if the handler calls glutDestroyWindow
>> as part of a timer or joystick handler,
>> FreeGLUT may still send joystick or draw events
>> to the window.
> Yes, this is one of the many known side effects of
> deffering the destruction of windows until later.
> glut destroyed windows immediatly. freeglut used
> to do so as well. I have been contemplating reverting
> this change. Another option is having
> glutDestroyWindow() unset all callbacks and zero
> the window's ID.
I would suggest clearing all the callbacks for a window
in fgAddToWindowDestroyList. This would ensure that
an application will receive no more events (death via
glutDestroyWindow() is final!) once the window is
However, this can certainly wait until RC6 or 2.0.0
is resolved.. :-)