Re: Crash and dispatch queue
Re: Crash and dispatch queue
- Subject: Re: Crash and dispatch queue
- From: "Zajkowski, James" <email@hidden>
- Date: Thu, 17 Nov 2011 20:47:28 +0000
- Thread-topic: Crash and dispatch queue
On Nov 17, 2011, at 1:49 PM, James Maxwell wrote:
> dispatch_async(queue,^{
> [myObject doSomeHorrificCrunching];
> [myObject saveDataToFile];
> });
My first guess is the (parent) function that is calling dispatch_async, somewhere (or some other function it calls) is releasing or otherwise invalidating myObject, or something that myObject relies on, before doSomeHorrificCrunching completes.
You didn't mention if running it without the dispatch queue would crash it - although you did say switching to dispatch_sync does stop it from crashing.
You didn't mention if you are using the dispatch queue as a synchronizer for multiple access or not; that is, all the calls that touch myObject, are they issued from blocks on the same queue?
I'd probably start by nslogging points where threads might end and see if you're getting events out of order.
--Jim
_______________________________________________
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