FROM : Randall Meadows
DATE : Thu Feb 14 21:54:49 2008
On Feb 14, 2008, at 1:12 PM, Nick Zitzmann wrote:
> 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.
Yes, of course, my bad.
> 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.
I took that to mean that has the same effect on the *contents* of the
pool (that is, releasing everything contained in the pool) but doesn't
release the pool itself. Am I being too liberal in my interpretation,
or are you talking about something else?
DATE : Thu Feb 14 21:54:49 2008
On Feb 14, 2008, at 1:12 PM, Nick Zitzmann wrote:
> 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.
Yes, of course, my bad.
> 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.
I took that to mean that has the same effect on the *contents* of the
pool (that is, releasing everything contained in the pool) but doesn't
release the pool itself. Am I being too liberal in my interpretation,
or are you talking about something else?






Cocoa mail archive

