Performing cache callbacks from the ioQueue asynchronously.

- more appropriate than dispatch_main_sync_safe, since we’ll always be on the ioQueue when calling
- prevents deadlock situation described in #625
This commit is contained in:
Matej Bukovinski 2014-03-24 20:14:18 +01:00
parent 4b26a89ac4
commit dd682c92b5
1 changed files with 3 additions and 3 deletions

View File

@ -296,7 +296,7 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
[self.memCache setObject:diskImage forKey:key cost:cost];
}
dispatch_main_sync_safe(^{
dispatch_async(dispatch_get_main_queue(), ^{
doneBlock(diskImage, SDImageCacheTypeDisk);
});
}
@ -349,7 +349,7 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
error:NULL];
if (completion) {
dispatch_main_sync_safe(^{
dispatch_async(dispatch_get_main_queue(), ^{
completion();
});
}
@ -486,7 +486,7 @@ BOOL ImageDataHasPNGPreffix(NSData *data) {
}
if (completionBlock) {
dispatch_main_sync_safe(^{
dispatch_async(dispatch_get_main_queue(), ^{
completionBlock(fileCount, totalSize);
});
}