Tweaked the safe release methodology for the copied blocks to remove un-necessary autorelease.

This commit is contained in:
andybee 2012-04-05 10:24:46 +02:00
parent f87c057cb8
commit 5cacab1b30
1 changed files with 4 additions and 2 deletions

View File

@ -129,9 +129,11 @@ static SDWebImageManager *instance;
// Check the on-disk cache async so we don't block the main thread // Check the on-disk cache async so we don't block the main thread
[cacheDelegates addObject:delegate]; [cacheDelegates addObject:delegate];
[cacheURLs addObject:url]; [cacheURLs addObject:url];
SuccessBlock successCopy = SDWIAutorelease([success copy]); SuccessBlock successCopy = [success copy];
FailureBlock failureCopy = SDWIAutorelease([failure copy]); FailureBlock failureCopy = [failure copy];
NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:delegate, @"delegate", url, @"url", [NSNumber numberWithInt:options], @"options", successCopy, @"success", failureCopy, @"failure", nil]; NSDictionary *info = [NSDictionary dictionaryWithObjectsAndKeys:delegate, @"delegate", url, @"url", [NSNumber numberWithInt:options], @"options", successCopy, @"success", failureCopy, @"failure", nil];
SDWIRelease(successCopy);
SDWIRelease(failureCopy);
[[SDImageCache sharedImageCache] queryDiskCacheForKey:[url absoluteString] delegate:self userInfo:info]; [[SDImageCache sharedImageCache] queryDiskCacheForKey:[url absoluteString] delegate:self userInfo:info];
} }
#endif #endif