diff --git a/SDWebImage/SDWebImageCompat.h b/SDWebImage/SDWebImageCompat.h index ce068071..81ca2211 100644 --- a/SDWebImage/SDWebImageCompat.h +++ b/SDWebImage/SDWebImageCompat.h @@ -87,15 +87,11 @@ typedef void(^SDWebImageNoParamsBlock)(void); FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; -#ifndef dispatch_queue_async_safe -#define dispatch_queue_async_safe(queue, block)\ - if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\ +#ifndef dispatch_main_async_safe +#define dispatch_main_async_safe(block)\ + if (dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL) == dispatch_queue_get_label(dispatch_get_main_queue())) {\ block();\ } else {\ - dispatch_async(queue, block);\ + dispatch_async(dispatch_get_main_queue(), block);\ } #endif - -#ifndef dispatch_main_async_safe -#define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) -#endif