• 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: Terminating an Application ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Terminating an Application ?


  • Subject: Re: Terminating an Application ?
  • From: Brian Webster <email@hidden>
  • Date: Tue, 5 Nov 2002 11:24:00 -0600

On Tuesday, November 5, 2002, at 01:07 AM, Chris Ridd wrote:

On 5/11/02 3:31 am, Brian Webster <email@hidden> wrote:

On Monday, November 4, 2002, at 06:26 PM,
email@hidden wrote:

My question is, are there any hidden problems associated with
terminating an
OS X app in this fashion ?

Terminating an application using kill will mean that that application
won't have any chance to perform cleanup that it normally does on quit,

Your posted Applescript snippet might still be the safest way of stopping
GUI apps. I have no idea if Carbon apps typically catch signals or not, or
if Cocoa sets up default signal handlers to handle SIGTERM gracefully or
not.

You can catch those signals if you want, but I wouldn't think that you'd want to do things like put up save dialogs in a signal handler. Besides, the code that he posted was only dealing with Carbon and Cocoa apps that would show up in the process manager, so Apple events are the best way to go in this situation. Signals would be a more universal solution, though, if you're dealing with terminating an arbitrary process that might not respond to Apple events. Also, I believe that Cocoa does allow you to handle signals through the ExceptionHandling framework, plus provides some default behavior such as logging such signals, and of course you can always handle stuff on the UNIX level as well.

--
Brian Webster
email@hidden
http://homepage.mac.com/bwebster
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Terminating an Application ? (From: Chris Ridd <email@hidden>)

  • Prev by Date: Re: Change Unix Permissions
  • Next by Date: Re: end of sheet and re-activationg window
  • Previous by thread: Re: Terminating an Application ?
  • Next by thread: Re: Interface builder can't see my Java Library anymore in Jaguar
  • Index(es):
    • Date
    • Thread