Re: Threads and retain/release
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