*--shutdown procedure > >IF TYPE("goApp")=="O" AND NOT ISNULL(goApp) > RETURN goApp.OnShutDown()<hr> *goApp.onshutdown called and might be firing first message<hr> >ENDIF > >Cleanup()<hr> *Really no vital cleanup code unless development *you could completely remove it and use as a prg for development time<pr> *Most probably returning immediately .t. (CNTBAR("_msysmenu")=7)<hr> > >IF !glDebug<hr> * If ever cleanup could pass [if CNTBAR("_msysmenu")=7] * release all and clear all would cause glDebug to be released * and therefore an error would occur here * I think CNTBAR("_msysmenu")=7 now * and you go to else part<hr> > QUIT >ELSE > goApp.RELEASE<hr> * GoApp.release might be firing the message second time<hr> >ENDIF<hr> * Here the control would return to system - command window * What I culdn't understand if scenario is true what restores * the sysmenu, on error etc (or not restored ?)<hr> > >FUNCTION Cleanup > IF CNTBAR("_msysmenu")=7 > RETURN > ENDIF > ON ERROR > ON SHUTDOWN > SET CLASSLIB TO > SET PATH TO > RELEASE ALL > CLEAR ALL > CLOSE ALL > POP MENU _MSYSMENU > RETURN >ENDFUNC>