• 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
(NSThread) crash after pool release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(NSThread) crash after pool release


  • Subject: (NSThread) crash after pool release
  • From: email@hidden
  • Date: Thu, 22 Aug 2002 13:06:09 +0200

I have a little problem here that I haven't run into before.
After finishing all the code in a thread I've created I release all the
objects I alloc and the NSAutoreleasePool as last the one.

When I do this I get a EXC_BAD_ACCESS and has exited due to signal 11
(SIGSEGV) error.
It runs until I release the pool (according to the docs I have to do
this manually, right?)
So why should it crash, am i overlooking something???

Thanks,

Erick

- (void)copyData:(NSFileHandle*)handle {
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc] init];
NSRange whereTime,whereMS,copyRange;
NSString *temp;
NSString *string=[[NSString alloc] initWithData:[handle
readDataToEndOfFile] encoding:NSASCIIStringEncoding];
temp = [[NSString alloc] init];
whereTime = [string rangeOfString:@"time="
options:NSCaseInsensitiveSearch];
NSLog(@"%d",whereTime);
whereMS = [string rangeOfString:@" ms"
options:NSCaseInsensitiveSearch];
NSLog(@"%d",whereMS);

copyRange = NSMakeRange(whereTime.location +
whereTime.length+1,whereMS.location- 1 - (whereTime.location +
whereTime.length));
temp = [string substringWithRange: copyRange];

[timeText setString:temp];

[temp release];
[string release];
[pool release];
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: (NSThread) crash after pool release
      • From: email@hidden
  • Prev by Date: Re: What method to override to initialize fields on a form?
  • Next by Date: Re: (NSThread) crash after pool release
  • Previous by thread: Re: NEWBIE: Refresh Rate, how to find?
  • Next by thread: Re: (NSThread) crash after pool release
  • Index(es):
    • Date
    • Thread