Re: Autorelease pool - was Beginners question regarding NSFileHandle
Re: Autorelease pool - was Beginners question regarding NSFileHandle
- Subject: Re: Autorelease pool - was Beginners question regarding NSFileHandle
- From: Raphael Sebbe <email@hidden>
- Date: Tue, 7 Aug 2001 15:52:00 +0200
Hi,
The default autorelease pool is set up to release objects at the end of
the event loop, for example, after the methods corresponding to a "push
button" has been invoked.
Of course, if you have your own autorelease pool, it releases objects
when you release it :
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *array = [NSArray array];
...
[pool release]; // array receives a release at this time.
}
It is interseting, as an example, to have autorelease pool inside
"large" loops.
Raphael
On Tuesday, August 7, 2001, at 02:22 PM, Roger Gilliar wrote:
Thanks for all the input, but I have some problems to figure out, when
exactly the autorelease pool is checked ? The docs say soemthing like
"when
the application object get the 'focus'". But when exactly does this
happen ?
Regards
Roger