Making sure cache queries always callback in the main thread.
- queryDiskCacheForKey:done: now always invokes the callback in the main thread - removed the now redundant main thread dispatch in the image manager class
This commit is contained in:
parent
713a83381f
commit
9546c84f94
|
@ -189,8 +189,10 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
|
|||
[self.memCache setObject:diskImage forKey:key cost:image.size.height * image.size.width * image.scale];
|
||||
}
|
||||
|
||||
dispatch_async(dispatch_get_main_queue(), ^
|
||||
{
|
||||
doneBlock(diskImage, SDImageCacheTypeDisk);
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -85,12 +85,9 @@
|
|||
if (operation.isCancelled) return;
|
||||
|
||||
if (image)
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), ^
|
||||
{
|
||||
completedBlock(image, nil, cacheType, YES);
|
||||
[self.runningOperations removeObject:operation];
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue