• 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: Negm-Awad Amin <email@hidden>
  • Date: Mon, 11 Aug 2008 20:57:43 +0200


Am Mo,11.08.2008 um 20:33 schrieb Trygve Inda:

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.
[…]
What you are doing is finalization. In most cases this is simply a wrong design. -dealloc is for

1. memory management
2. memory management
3. memory management

It is not for additional functionality bound to an instance. (I do know what I talk about, because I did this mistake many times.)

If you find no other solution just register your threads (whatever) in the app-delegate and clean it up at -applicationDidFinishLaunching..


Amin Negm-Awad email@hidden




_______________________________________________

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


  • Follow-Ups:
    • Re: Delayed termination to allow release
      • From: Negm-Awad Amin <email@hidden>
References: 
 >Delayed termination to allow release (From: Trygve Inda <email@hidden>)

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