Re: applicationShouldTerminate delegate does not work in Leopard
Re: applicationShouldTerminate delegate does not work in Leopard
- Subject: Re: applicationShouldTerminate delegate does not work in Leopard
- From: Jens Miltner <email@hidden>
- Date: Thu, 17 Jan 2008 13:45:07 +0100
On 17.01.2008, at 12:54, Jean-Daniel Dupas wrote:
I'have just try with a background cocoa application on Leopard, and
the Activity Moniter call SIGINT. But you cannot do anything in a
signal handler, so it will not be helpfull.
static void sigtest(int arg) {
printf("%s\n", __func__);
}
signal(SIGINT, sigtest);
Well, you _can_ do some things in a signal handler (otherwise they
would be uterless unuseful ;-).
You could, e.g. set a flag or signal a semaphore - that's all within
the allowed APIs, IIRC.
You can't call any Cocoa functions directly, but you could have e.g. a
background thread block on a semaphore or mutex and signal/unlock from
the signal handler, then the background thread could perform a
selector on the main thread, etc.
Quite a bit jumping through hoops, but then again, if it's the only
option...
However, the OP meanwhile mentioned that no signals seem to be send to
the process, which seems a bit strange, as in my experience an app is
either send an appleevent or signalled...
</jum>
_______________________________________________
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