Re: Garbage collection in Python/Pyobjc
Nicholas Cole <[email protected]>
| Newsgroups | gmane.comp.python.pyobjc.devel |
|---|---|
| Message-ID | <CAAu18hfgokeUMUrVQZH8GADhCcYBW2xb0UcZRpGLToVeEG+DTg@mail.gmail.com> |
> On Jan 2, 2012, at 5:01 PM, James Eagan wrote: > >> Hi Peter, >> >> You’re right, this is standard Objective-C memory management issue, but thankfully its easy to fix. Just create a new NSAutoreleasePool at the top of your loop and del it at the bottom. As an example, here’s the processing loop from one of my projects : >> >> for image in images: >> pool = NSAutoreleasePool.alloc().init() >> try: >> buffers.append( self.processImage_(image) ) >> finally: >> del pool >> Does the NSAutoreleasePool object need to be called "pool"? How do objects created 'know' that there is a pool available? Best wishes, Nicholas ------------------------------------------------------------------------------ For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2