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 protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]