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:
Matej Bukovinski 2012-11-19 13:43:25 +01:00 committed by Olivier Poitrey
parent 713a83381f
commit 9546c84f94
2 changed files with 6 additions and 7 deletions

View File

@ -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);
});
});
}

View File

@ -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
{