Re: [pool release] causes error?
Re: [pool release] causes error?
- Subject: Re: [pool release] causes error?
- From: Elden Wood <email@hidden>
- Date: Sun, 27 Mar 2005 22:59:17 -0800
I have to agree that, as listed, this looks fine. In my experience
NSAutoreleasePools elegantly solve some problems and in theory you
don't have to really understand them. In practice though there are
subtleties. In this case I'd suspect that something was both added to
the autorelease pool and released. That would cause the delayed release
during [pool release] to crash since it's no longer a valid object
inside the autorelease pool.
Another unrelated problem I've seen is when a thread runs for a *long*
time w/o returning and puts lots of stuff into the autorelease pool. In
that case memory usage grows until something fails even though
everything along the way has been correctly marked for eventual
cleanup.
--
Elden Wood
Clarkwood Software, LLC
http://www.clarkwood.com/
Mac OS X Software
On Mar 27, 2005, at 6:29 PM, Daniel Child wrote:
Hi All,
I must be missing something obvious, but I get a strange error if I
try to release the autorelease pool.
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *path;
DataParser *dp;
NSMutableArray *theRecords;
NSEnumerator *recsEnum;
path = [@"~/Documents/PROGRAMMING/pangWords.txt"
stringByExpandingTildeInPath];
dp = [DataParser parserWithRecordDelim:@"\n"];
theRecords = [dp parseFileAtPath: path];
[pool release]; // causes BAD EXC ACCESS (exits with signal 11
(SIGSEGV))
return 0;
What would cause this? Thanks...
_______________________________________________
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