Re: How to terminate an NSTask whenever my app terminates?
Re: How to terminate an NSTask whenever my app terminates?
- Subject: Re: How to terminate an NSTask whenever my app terminates?
- From: Scott Ribe <email@hidden>
- Date: Mon, 31 Aug 2015 20:50:41 -0600
Normally, when a parent exits, all child processes are killed. This is not specific to terminal/tty sessions. However, a process can be detached from its parent so that it will survive the parent's exit. I doubt that NSTask does this, but you should verify.
Create a dummy helper: int main() {while(1) sleep(1);}
Use NSTask to launch it. Kill your parent in various ways and verify that the child gets killed: kill -9, call abort, crash it with the time-honored *(char*)0 = 0.
--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden