Re: [Pyobjc-dev] Garbage collection in Python/Pyobjc
Brought to you by:
ronaldoussoren
From: Nicholas C. <nic...@gm...> - 2012-04-16 13:00:06
|
> 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 |