Re: Daemon Advice?
Re: Daemon Advice?
- Subject: Re: Daemon Advice?
- From: Nick Zitzmann <email@hidden>
- Date: Wed, 23 Jul 2008 15:20:22 -0600
On Jul 23, 2008, at 2:09 PM, Karl Moskowski wrote:
void handleSignal (int signal) {
NSLog(@"Shutting daemon down");
AnObject * anObject = [[AnObject alloc] init];
[anObject doCleanup];
[[NSDistributedNotificationCenter defaultCenter]
postNotificationName:@"DaemonHasShutDown" object:nil userInfo:nil
options:NSNotificationPostToAllSessions];
exit(EXIT_SUCCESS);
}
int main (int argc, const char * argv[]) {
signal (SIGTERM, handleSignal);
signal (SIGINT, handleSignal);
Calling ObjC methods in a signal handler is not a good idea: <http://lists.apple.com/archives/Cocoa-dev/2001/Dec/msg00159.html
>
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
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