Customized glut main loop = works

however, exiting qt window ==> segfault
and      execiting gl window ==> window stops update but doesn't die