glutDestroyWindow man page
glutDestroyWindow — Destroy a window and associated subwindows
OpenGLUT - window
After this function is invoked, the only further event that may be delivered for your window is the one for its destruction. All other events should be discarded.
Once a window has been destroyed, further attempts to use the window named bywindowID
are undefined. OpenGLUT generally tries to be sensible, and should not recycle the deadwindowID,
but you should treat a destroyed window much like a pointer to deallocated memory and try not to use it.
glutCloseFunc(3), glutCreateMenuWindow(3), glutCreateSubWindow(3), glutCreateWindow(3), glutSetOption(3).