Re: Automatically terminating application
Re: Automatically terminating application
- Subject: Re: Automatically terminating application
- From: Wim Lewis <email@hidden>
- Date: Wed, 7 Oct 2009 19:57:43 -0700
On Oct 7, 2009, at 1:44 PM, Daniel Ketel wrote:
[...] I must have done something wrong, the application seems to get
confused or I don't know what. The system itself still is running,
but somehow the application is ignoring ANY input, but since it
covers up the whole screen and ignores the input, I have no means of
terminating the application. I can't switch to Activity Monitor or
back to xcode or anything...
[...] So I though there might be something built into xcode (or
something in the xcode-package) like a timer to terminate an
application. For example before starting my application in debug
mode I would set the timer to say 10 seconds, and after 10 seconds
the application will be killed automagically, regardless of what it
is doing. Would help me a lot, since I wouldn't have to force-kill
the whole system (forced shutdown...). Any ideas?
You could use the alarm() syscall. This will schedule a SIGALARM to be
sent to your process in some number of seconds. If you don't have a
signal handler set up for that signal (and by default, you don't),
then your program will be terminated. Just put a line like "alarm
(10);" near the beginning of main().
(If you have another machine available, even a non-Mac, then using ssh
to log in and kill the process is probably the easiest route, as Jens
Alfke suggests.)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden