diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 57778cf54..04468472c 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -296,7 +296,7 @@ - (NSOperation *)queryDiskCacheForKey:(NSString *)key done:(void (^)(UIImage *im [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 @@ - (void)clearDiskOnCompletion:(void (^)())completion error:NULL]; if (completion) { - dispatch_main_sync_safe(^{ + dispatch_async(dispatch_get_main_queue(), ^{ completion(); }); } @@ -486,7 +486,7 @@ - (void)calculateSizeWithCompletionBlock:(void (^)(NSUInteger fileCount, NSUInte } if (completionBlock) { - dispatch_main_sync_safe(^{ + dispatch_async(dispatch_get_main_queue(), ^{ completionBlock(fileCount, totalSize); }); }