Re: Unconventional memory leak problem
Re: Unconventional memory leak problem
- Subject: Re: Unconventional memory leak problem
- From: John Stiles <email@hidden>
- Date: Wed, 6 Sep 2006 16:27:47 -0700
On Sep 6, 2006, at 4:11 PM, Raffael Cavallaro 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?
I have used performSelectorOnMainThread without explicitly making an
autorelease pool, and it seems to work fine—I don't get any leak
messages.
The docs don't seem to specify whether you need to create a pool, or
whether the OS will do it for you, so I'm not going to call anyone
wrong. But in my experience, no, you don't need an autorelease pool
for this (unless your app, like the OP's app, has the potential to
overflow the heap in the user's absence due to a buildup of unreaped
objects). _______________________________________________
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