NSThread and memory management
NSThread and memory management
- Subject: NSThread and memory management
- From: Rob Rix <email@hidden>
- Date: Mon, 2 Jul 2001 15:28:31 -0400
Hey, all.
I'm writing a Foundation Tool which uses multiple threads. I'm setting up
connections between threads like in the NSConnection documentation; I spin
off a class method in a new thread, and it creates an instance of the
object and sets up the autorelease pool and connection, et cetera.
When the controlling object (in the main thread) is finished what it is
doing, I want it to remove the thread it spawned. So, obviously it can
send a message to the object in the new thread, which can call [NSThread
exit], but what I want to know is whether or not this will leak:
Will the autorelease pool and other objects in the spawned thread be
removed when the thread exits?
If so, things are easy, if not, I have another solution that will work.
Just curious.
-- Rob
TINRA - There Is No Right Answer