Re: Size limit of NSData or NSFileHandle?
Re: Size limit of NSData or NSFileHandle?
- Subject: Re: Size limit of NSData or NSFileHandle?
- From: glenn andreas <email@hidden>
- Date: Mon, 10 Apr 2006 19:57:57 -0500
On Apr 10, 2006, at 9:54 AM, Ondra Cada wrote:
Glenn,
On 10.4.2006, at 16:47, glenn andreas wrote:
for (;;) {
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
NSData *data=[fh availableData];
if (![data length]) break;
...
[pool release];
}
Depending on the task it might be better to release the pool not
each time, but every N times, yadda yadda yadda :)
This will result in a leak as well, since when the break is hit,
neither the pool, nor anything in it, will be released.
Nope it won't. Autorelease pools are smart enough -- the last one
gets automatically taken care of by the parent pool.
Well, what do you know:
If you neglect to send release to an autorelease pool when you are
finished with it (something not recommended), it is released when
one of the autorelease pools in which it nests is released.
And here I've just been paranoid for all these years (though it seems
that this paranoia at least was recommended).
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden