Re: NSXMLParser, streams, multiple threads, and crashing
Re: NSXMLParser, streams, multiple threads, and crashing
- Subject: Re: NSXMLParser, streams, multiple threads, and crashing
- From: Andreas Grosam <email@hidden>
- Date: Sun, 22 Jan 2012 14:35:38 +0100
On Jan 22, 2012, at 2:15 PM, Thomas Davie wrote:
> OSPConnection *rec = [[self connectionQueue] objectAtIndex:0];
> [[self connectionQueue] removeObjectAtIndex:0];
> [[self currentConnections] addObject:rec];
Not sure if this is related to your issue, but basically, the lines above are potentially dangerous. You should mention which memory management model you are using: GC, ARC or manual.
Writing it the way below should be safe in all cases and doesn't hurt at all otherwise:
OSPConnection *rec = [[self connectionQueue] objectAtIndex:0];
[[self currentConnections] addObject:rec];
[[self connectionQueue] removeObjectAtIndex:0];
Andreas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden