• 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: Getting Default Output Device gives a strange answer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting Default Output Device gives a strange answer


  • Subject: Re: Getting Default Output Device gives a strange answer
  • From: Jeff Moore <email@hidden>
  • Date: Tue, 14 Nov 2006 18:44:05 -0800

Yes, a signal handler would be a fine idea. However, you need to be careful with signal handlers though. You really can't do anything in them as the execution environment is not the normal one. For example, you shouldn't allocate/deallocate memory and many system APIs won't work correctly.

In my command line tools, I use the signal handler to set a flag that the tool's main run loop is looking at that indicates it's time to clean up and quit. I then handle actually cleaning up and quitting on the main thread when it exits the run loop.

On Nov 14, 2006, at 4:56 PM, Andrew Kimpton wrote:

Steve Checkoway wrote:
Andrew Kimpton wrote:

In order to avoid this sort of thing should I make sure to install some sort of 'atexit' handler to release hog mode before the app quits ? That won't protect against crashes but would at least protect against impatient 'ctrl-c' usage.

If I were you, I'd install a signal handler to catch ^C and ^\ and so forth and try to shut down gracefully, assuming this is an option for you.


Yep - it sounds like catching the signals is the best way to do things, as Jeff previously noted the order of atexit calls is unpredictable and may not help avoid the 'wedged' state.


--

Jeff Moore
Core Audio
Apple


_______________________________________________ Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Getting Default Output Device gives a strange answer (From: Andrew Kimpton <email@hidden>)
 >Re: Getting Default Output Device gives a strange answer (From: Jeff Moore <email@hidden>)
 >Re: Getting Default Output Device gives a strange answer (From: Andrew Kimpton <email@hidden>)
 >Re: Getting Default Output Device gives a strange answer (From: Jeff Moore <email@hidden>)
 >Re: Getting Default Output Device gives a strange answer (From: Andrew Kimpton <email@hidden>)
 >Re: Getting Default Output Device gives a strange answer (From: Steve Checkoway <email@hidden>)
 >Re: Getting Default Output Device gives a strange answer (From: Andrew Kimpton <email@hidden>)

  • Prev by Date: Re: Getting Default Output Device gives a strange answer
  • Next by Date: SoundDescription
  • Previous by thread: Re: Getting Default Output Device gives a strange answer
  • Next by thread: Re: Getting Default Output Device gives a strange answer
  • Index(es):
    • Date
    • Thread