Joseph Heenan
Committed by Ben Copsey

Fix for crash when cancelling requests.

It seems that notifying the NSOperationQueue we're complete before we start running causes a problem resulting in a crash.

Hence, we avoid calling markAsFinished unless we're inprogress - main() will call it when we do start.
... ... @@ -1711,6 +1711,12 @@ static NSOperationQueue *sharedQueue = nil;
[failedRequest reportFailure];
if (!inProgress)
{
// if we're not in progress, we can't notify the queue we've finished (doing so can cause a crash later on)
// "markAsFinished" will be at the start of main() when we are started
return;
}
// markAsFinished may well cause this object to be dealloced
[self retain];
[self markAsFinished];
... ...