glViewer: exit when the window is closed