glutDestroyWindow crash


I am having a crash destroying the glut window when I resize the application. The resize code just destroys the old window and creates a new one with the desired resolution, but when I destroy the window it crashes and this only happens in some SO.
In my case is on a Windows 7 32 bits, with a graphic card Mobile Intel® 965 Express Chipset Family. In other computers works without any problem.

The resize code is being executed inside the glutIdleFunc so maybe when destroying the window this function is being destroyed… Any idea someone?

I think you should ensure all pending functions to be finished first, like stopping the rendering, the timer functions and idle functions.

Otherwise, it can be a bug, but I think noone will change it…