Re: In-loop releasing of objects does not free memory?
Re: In-loop releasing of objects does not free memory?
- Subject: Re: In-loop releasing of objects does not free memory?
- From: Uli Kusterer <email@hidden>
- Date: Thu, 14 Feb 2008 20:49:16 +0100
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:
This email sent to email@hidden