• 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: Delayed termination to allow release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Delayed termination to allow release


  • Subject: Re: Delayed termination to allow release
  • From: David Duncan <email@hidden>
  • Date: Mon, 11 Aug 2008 11:44:36 -0700

On Aug 11, 2008, at 11:33 AM, Trygve Inda wrote:

My main thread creates a few other objects which have NSThreads and/or
timers. I have found that when I quit the app, and the threads are ended,
something in the OS is retaining my objects for a bit... They end up never
being dealloc'd which messes a few things up as some data is written to disk
at this point.


-dealloc is short circuited when an application is quit (as deallocation is going to occur due to the application's memory space going away).

You should arrange for things that need to occur on application quit to occur in -applicationShouldTerminate: without relying on object lifetimes to do this (if you ever write a GC enabled application you will find you have the same issues in that you cannot message an object in -finalize reliably).
--
David Duncan
Apple DTS Animation and Printing


_______________________________________________

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


References: 
 >Delayed termination to allow release (From: Trygve Inda <email@hidden>)

  • Prev by Date: Opening an external file in a external application
  • Next by Date: Re: Delayed termination to allow release
  • Previous by thread: Delayed termination to allow release
  • Next by thread: Re: Delayed termination to allow release
  • Index(es):
    • Date
    • Thread