Re: NSXMLParser, streams, multiple threads, and crashing
Re: NSXMLParser, streams, multiple threads, and crashing
- Subject: Re: NSXMLParser, streams, multiple threads, and crashing
- From: Thomas Davie <email@hidden>
- Date: Sun, 22 Jan 2012 13:51:10 +0000
Thanks Andreas,
I am indeed using ARC, so the code should be safe enough, as ARC will retain rec for me.
Cheers for taking a look though
Tom Davie
if (*ra4 != 0xffc78948) { return false; }
On 22 Jan 2012, at 13:35, Andreas Grosam wrote:
>
> 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
_______________________________________________
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
- Prev by Date:
Re: NSXMLParser, streams, multiple threads, and crashing
- Next by Date:
Re: Cocoa-dev Digest, Vol 9, Issue 37
- Previous by thread:
Re: NSXMLParser, streams, multiple threads, and crashing
- Next by thread:
Re: NSXMLParser, streams, multiple threads, and crashing
- Index(es):