FROM : Nick Zitzmann
DATE : Thu Feb 14 21:12:13 2008
On Feb 14, 2008, at 12:49 PM, Uli Kusterer wrote:
> 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.
That'll cause a crash if GC isn't being used, since -drain is
documented as doing the same thing as -release in non-GC applications.
Nick Zitzmann
<http://www.chronosnet.com/>
DATE : Thu Feb 14 21:12:13 2008
On Feb 14, 2008, at 12:49 PM, Uli Kusterer wrote:
> 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.
That'll cause a crash if GC isn't being used, since -drain is
documented as doing the same thing as -release in non-GC applications.
Nick Zitzmann
<http://www.chronosnet.com/>






Cocoa mail archive

