Re: Re: Unconventional memory leak problem
Re: Re: Unconventional memory leak problem
- Subject: Re: Re: Unconventional memory leak problem
- From: "Tom Harrington" <email@hidden>
- Date: Wed, 6 Sep 2006 17:45:41 -0600
On 9/6/06, Raffael Cavallaro <email@hidden> wrote:
On Sep 6, 2006, at 7:03 PM, John Stiles wrote:
> I think you need to re-read the OP's root problem. His issue wasn't
> the lack of a pool. In his case, there is an autorelease pool in
> place, but it is not being drained until the event loop sees user
> activity.
I understand this. I'm simply responding to the OP's own statement -
that each invocation of performSelectorOnMainThread:(SEL)aSelector
withObject:waitUntilDone: needs an autorelease pool for the selector.
Either this is so, or it isn't. In my experience it is - i.e., if I
don't use one I get console messages saying that it's just leaking
(no pool in place). Are both the OP and I wrong about this?
You don't get console messages about leaking unless there's no
autorelease pool available at all.
However, just because an autorelease pool is in place does not mean it
is getting drained at regular intervals. If-- as in this case-- you
have a situation where you may end up with a lot of autoreleased
objects, and a long time between draining the pool-- you may need to
set up a secondary, local autorelease pool so that you can release the
pool and therefore clean up any objects it's holding on to.
The lack of this secondary pool will not lead to console messages
about leaking, but it may lead to unexpectedly high memory
requirements.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
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