Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In-loop releasing of objects does not free memory?



On 14.02.2008, at 17:31, Randall Meadows wrote:
NSAutoreleasePool * loopPool = [[NSAutoreleasePool alloc] init];
{  // loop
 <do various things>
 [loopPool drain];
}


Just for completeness' sake, this should really be:

NSAutoreleasePool * loopPool = [[NSAutoreleasePool alloc] init];
while( whatever ) // loop
{
    // do stuff here.
    [loopPool drain];
}
[loopPool release];    // don't forget this.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Terranova <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Stiles <email@hidden>)
 >RE: In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Randall Meadows <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.