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];
|
[self.memCache setObject:diskImage forKey:key cost:image.size.height * image.size.width * image.scale];
|
||||||
}
|
}
|
||||||
|
|
||||||
doneBlock(diskImage, SDImageCacheTypeDisk);
|
dispatch_async(dispatch_get_main_queue(), ^
|
||||||
|
{
|
||||||
|
doneBlock(diskImage, SDImageCacheTypeDisk);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,11 +86,8 @@
|
||||||
|
|
||||||
if (image)
|
if (image)
|
||||||
{
|
{
|
||||||
dispatch_async(dispatch_get_main_queue(), ^
|
completedBlock(image, nil, cacheType, YES);
|
||||||
{
|
[self.runningOperations removeObject:operation];
|
||||||
completedBlock(image, nil, cacheType, YES);
|
|
||||||
[self.runningOperations removeObject:operation];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue