• 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: Will sleep/wake notification handles close themselves at process termination?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Will sleep/wake notification handles close themselves at process termination?


  • Subject: Re: Will sleep/wake notification handles close themselves at process termination?
  • From: Soren Spies <email@hidden>
  • Date: Mon, 22 Nov 2010 20:54:01 -0800


On Nov 22, 2010, at 20:18, Julian Hsiao wrote:

I'm writing a very simple program that processes sleep/wake notifications based on the sample codes in QA1340, and I'm wondering if I don't call IODeregisterForSystemPower(), IOServiceClose(), and IONotificationPortDestroy() before exiting, will I leak kernel resources?  And if clean up is not optional, is there a way to "name" the handles so that if my program terminated abnormally, I can still clean up the leaks afterward?

I'm pretty sure abnormal exit of your program will cause the resources pointed to by these handle to be cleaned up.  The resources are primarily user client objects (visible in IO Registry Explorer) so you should be able to see them getting cleaned up when your program exits.


-Soren
IO Team


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Will sleep/wake notification handles close themselves at process termination? (From: Julian Hsiao <email@hidden>)

  • Prev by Date: Will sleep/wake notification handles close themselves at process termination?
  • Next by Date: Re: is it possible to find the target OS version from the binary?
  • Previous by thread: Will sleep/wake notification handles close themselves at process termination?
  • Next by thread: capturing and printing timestamps
  • Index(es):
    • Date
    • Thread