Fix for invalid operation on GL window when the game exits.