Re: AutoreleasePool mechanics
Re: AutoreleasePool mechanics
- Subject: Re: AutoreleasePool mechanics
- From: email@hidden (mikevannorsdel)
- Date: Thu, 20 Dec 2001 09:31:26 -0700
Thanks. This is about what I thought, but I wanted to double check so I
wasn't leaving objects here and there when they weren't needed.
On 12/20/01 9:06 AM, "Ondra Cada" <email@hidden> wrote:
>
I am quite positive this is documented as well (though I don't just now
>
remember where exactly): for each event loop a new pool is created (and
>
destroyed when then even loop ends). Something like
>
>
while (evt=lowLevelServiceToGetTheNextEvent()) {
>
id pool=[[NSAutoreleasePool alloc] init];
>
[NSApp sendEvent:evt];
>
[pool relese];
>
}
>
>
though the actual implementation would be naturally more complicated.
>
>
So, unless you create a big pile of objects inside one event, there's no fear.