• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to terminate an NSTask whenever my app terminates?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to terminate an NSTask whenever my app terminates?
      • From: Ken Thomases <email@hidden>
    • Re: How to terminate an NSTask whenever my app terminates?
      • From: Michael David Crawford <email@hidden>
References: 
 >How to terminate an NSTask whenever my app terminates? (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: NSTableView: Rows from bottom up
  • Next by Date: Re: How to terminate an NSTask whenever my app terminates?
  • Previous by thread: Re: How to terminate an NSTask whenever my app terminates?
  • Next by thread: Re: How to terminate an NSTask whenever my app terminates?
  • Index(es):
    • Date
    • Thread