• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [pool release] causes error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >[pool release] causes error? (From: Daniel Child <email@hidden>)

  • Prev by Date: Re: [pool release] causes error?
  • Next by Date: NSHomeDirectory() vs. -stringByExpandingTildeInPath
  • Previous by thread: Re: [pool release] causes error?
  • Next by thread: NSTableColumn & binding value
  • Index(es):
    • Date
    • Thread