• 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: Threads and retain/release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Threads and retain/release


  • Subject: Re: Threads and retain/release
  • From: Michael Ash <email@hidden>
  • Date: Tue, 26 May 2009 11:07:09 -0400

On Tue, May 26, 2009 at 10:41 AM, Dave DeLong <email@hidden> wrote:
> All of this works fine.  My question has to do with memory management and thread cleanup.

I'm snipping out most of your message because I think that all will
make sense once you know this one fact:

NSThread retains the target and argument of the thread until the
thread terminates.

Since NSThread takes ownership of those objects when you create the
thread, you can rely on them to stay alive as long as the thread is
running. Thus, perform memory management as usual, and don't worry
about your thread object getting deallocated before you finish
executing the thread, because it can't happen unless you've violated
the memory-management rules and over-released something.

Mike
_______________________________________________

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: Threads and retain/release
      • From: Dave DeLong <email@hidden>
References: 
 >Threads and retain/release (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Core data, bindings and multiple view NIBs
  • Next by Date: Re: NSWindow in threads
  • Previous by thread: Threads and retain/release
  • Next by thread: Re: Threads and retain/release
  • Index(es):
    • Date
    • Thread