Is it ok using WaitForChildExit(0) this way?

1 post / 0 new
jabirulo
jabirulo's picture
Offline
Last seen: 17 hours 4 min ago
Joined: 2013-05-30 00:53
Is it ok using WaitForChildExit(0) this way?

Hi, I open some window using CreateNewProcTags()

and then when quitting main program I use:

  1. ...
  2. if(/*dd->win[WID_MAIN]==NULL &&*/ dd->WinProc) {
  3. IExec->Signal( (struct Task *)dd->WinProc, SIGBREAKF_CTRL_F );
  4. }
  5.  
  6. if(/*dd->win[WID_PREFS]==NULL &&*/ dd->PrefsProc) {
  7. IExec->Signal( (struct Task *)dd->PrefsProc, SIGBREAKF_CTRL_F );
  8. }
  9.  
  10. IDOS->WaitForChildExit(0);
  11. ...

is it ok?

Or "better" GetPID() of win/prefs process and then " IDOS->WaitForChildExit();"

TiA