• 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: Trygve Inda <email@hidden>
  • Date: Mon, 11 Aug 2008 19:03:00 +0000
  • Thread-topic: Delayed termination to allow release

> --- On Mon, 8/11/08, Trygve Inda <email@hidden> 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.
>
>> From the docs:
> "Note that when an application terminates, objects may not be sent a dealloc
> message since the process’s memory is automatically cleared on exit—it is more
> efficient simply to allow the operating system to clean up resources than to
> invoke all the memory management methods."
>
> In other words, you shouldn't assume dealloc will be called and it's generally
> not a good idea to perform essential cleanup there. The designated place for
> application cleanup code is applicationWillTerminate:.
>
> Cheers,
> Chuck


Hmmm... This is not so much my app cleaning up (it is not dealloc on my
AppController) but a series of sub objects which dealloc. I guess I'll have
to break out the cleanup code... Makes it less clean :) , but oh well.

T.


_______________________________________________

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: 
 >Re: Delayed termination to allow release (From: Charles Steinman <email@hidden>)

  • Prev by Date: Re: Use of AppKit in command-line app on headless node
  • Next by Date: Re: Delayed termination to allow release
  • Previous by thread: Re: Delayed termination to allow release
  • Next by thread: Re: Delayed termination to allow release
  • Index(es):
    • Date
    • Thread