Re: Terminating an Application ?
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.