Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AFNetworking/AFNetworking
Browse files Browse the repository at this point in the history
  • Loading branch information
mattt committed Dec 27, 2012
2 parents a9b9ebe + 4fd322e commit fc60c57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion AFNetworking/AFHTTPClient.m
Expand Up @@ -573,8 +573,9 @@ - (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations

for (AFHTTPRequestOperation *operation in operations) {
AFCompletionBlock originalCompletionBlock = [operation.completionBlock copy];
__weak AFHTTPRequestOperation *weakOperation = operation;
operation.completionBlock = ^{
dispatch_queue_t queue = operation.successCallbackQueue ?: dispatch_get_main_queue();
dispatch_queue_t queue = weakOperation.successCallbackQueue ?: dispatch_get_main_queue();
dispatch_group_async(dispatchGroup, queue, ^{
if (originalCompletionBlock) {
originalCompletionBlock();
Expand Down
4 changes: 2 additions & 2 deletions AFNetworking/AFImageRequestOperation.m
Expand Up @@ -82,7 +82,7 @@ + (AFImageRequestOperation *)imageRequestOperationWithRequest:(NSURLRequest *)ur
dispatch_async(image_request_operation_processing_queue(), ^(void) {
UIImage *processedImage = imageProcessingBlock(image);

dispatch_async(requestOperation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) {
dispatch_async(operation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) {
success(operation.request, operation.response, processedImage);
});
});
Expand Down Expand Up @@ -113,7 +113,7 @@ + (AFImageRequestOperation *)imageRequestOperationWithRequest:(NSURLRequest *)ur
dispatch_async(image_request_operation_processing_queue(), ^(void) {
NSImage *processedImage = imageProcessingBlock(image);

dispatch_async(requestOperation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) {
dispatch_async(operation.successCallbackQueue ?: dispatch_get_main_queue(), ^(void) {
success(operation.request, operation.response, processedImage);
});
});
Expand Down

0 comments on commit fc60c57

Please sign in to comment.