Fix retain cycles detected by Xcode 4.6 static analyzer

This commit is contained in:
Blake Watters
2012-11-05 17:13:58 -05:00
parent d71a6a3482
commit e7505df56c
2 changed files with 5 additions and 3 deletions

View File

@@ -572,8 +572,9 @@ static NSString *RKMIMETypeFromAFHTTPClientParameterEncoding(AFHTTPClientParamet
for (RKObjectRequestOperation *operation in operations) {
void (^originalCompletionBlock)(void) = [operation.completionBlock copy];
__weak RKObjectRequestOperation *weakOperation = operation;
[operation setCompletionBlock:^{
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();