• 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: AutoReleasePool question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AutoReleasePool question.


  • Subject: Re: AutoReleasePool question.
  • From: Joseph Kelly <email@hidden>
  • Date: Mon, 27 Mar 2006 14:40:40 -0800


On Mar 25, 2006, at 7:12 PM, John Draper wrote:

But am I supposed to wrap this above code in the C++ threads?


Yep -- if your C++ threads do anything at all Cocoa-ish, then you need to set up the an autorelease pool.

If so,  what part of the thread?   The part that gets called repeatedly, or the

part the initializes the thread... 


It depends. If your thread starts up, and loops indefinitely (in some kind of CFRunLoop/NSRunLoop, right ;-), you will need to put the autorelease pool in the loop. If, on the other hand, the thread is started, does some work, then quits, it might suffice to put the autorelease pool in the thread's invocation routine.

Also, anytime the system calls back into your code, you should set up an autorelease pool -- this applies not only to thread invocations, but for run loop and timer callbacks.

joe


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >AutoReleasePool question. (From: John Draper <email@hidden>)

  • Prev by Date: porting to Xcode, weak linking and other fun stuff...
  • Next by Date: compilation inconsitencies
  • Previous by thread: Re: AutoReleasePool question.
  • Next by thread: lipo doesn't touch (in the timestamp modification sense) the output file?
  • Index(es):
    • Date
    • Thread