Authored by Matej Bukovinski
Committed by Olivier Poitrey

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
... ... @@ -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];
}
doneBlock(diskImage, SDImageCacheTypeDisk);
dispatch_async(dispatch_get_main_queue(), ^
{
doneBlock(diskImage, SDImageCacheTypeDisk);
});
});
}
... ...
... ... @@ -86,11 +86,8 @@
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
{
... ...