• 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
NSThread and memory management
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSThread and memory management
      • From: Rob Rix <email@hidden>
    • Re: NSThread and memory management
      • From: Rob Rix <email@hidden>
    • Re: NSThread and memory management
      • From: Luc Heinrich <email@hidden>
  • Prev by Date: Re: [HELP] How to change Desktop background pic in OSX from Cocoa-Java?
  • Next by Date: Re: boolean into NSDictionary
  • Previous by thread: Re: [OT] Best 3D format for Cocoa apps
  • Next by thread: Re: NSThread and memory management
  • Index(es):
    • Date
    • Thread