diff --git a/SDWebImage/SDImageCache.m b/SDWebImage/SDImageCache.m index 15d27d17..b94a8005 100644 --- a/SDWebImage/SDImageCache.m +++ b/SDWebImage/SDImageCache.m @@ -50,7 +50,7 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { @property (strong, nonatomic, nonnull) NSCache *memCache; @property (strong, nonatomic, nonnull) NSString *diskCachePath; @property (strong, nonatomic, nullable) NSMutableArray *customPaths; -@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t ioQueue; +@property (strong, nonatomic, nullable) dispatch_queue_t ioQueue; @end @@ -129,7 +129,6 @@ FOUNDATION_STATIC_INLINE NSUInteger SDCacheCostForImage(UIImage *image) { - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - SDDispatchQueueRelease(_ioQueue); } - (void)checkIfQueueIsIOQueue { diff --git a/SDWebImage/SDWebImageCodersManager.m b/SDWebImage/SDWebImageCodersManager.m index 23bc4c42..6134aa88 100644 --- a/SDWebImage/SDWebImageCodersManager.m +++ b/SDWebImage/SDWebImageCodersManager.m @@ -15,8 +15,8 @@ @interface SDWebImageCodersManager () -@property (nonatomic, strong, nonnull) NSMutableArray* mutableCoders; -@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue; +@property (strong, nonatomic, nonnull) NSMutableArray* mutableCoders; +@property (strong, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue; @end @@ -43,10 +43,6 @@ return self; } -- (void)dealloc { - SDDispatchQueueRelease(_mutableCodersAccessQueue); -} - #pragma mark - Coder IO operations - (void)addCoder:(nonnull id)coder { diff --git a/SDWebImage/SDWebImageCompat.h b/SDWebImage/SDWebImageCompat.h index 2a6caa38..ce068071 100644 --- a/SDWebImage/SDWebImageCompat.h +++ b/SDWebImage/SDWebImageCompat.h @@ -81,18 +81,6 @@ #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type #endif -#if OS_OBJECT_USE_OBJC - #undef SDDispatchQueueRelease - #undef SDDispatchQueueSetterSementics - #define SDDispatchQueueRelease(q) - #define SDDispatchQueueSetterSementics strong -#else - #undef SDDispatchQueueRelease - #undef SDDispatchQueueSetterSementics - #define SDDispatchQueueRelease(q) (dispatch_release(q)) - #define SDDispatchQueueSetterSementics assign -#endif - FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); typedef void(^SDWebImageNoParamsBlock)(void); diff --git a/SDWebImage/SDWebImageCompat.m b/SDWebImage/SDWebImageCompat.m index d49334d2..bb53495e 100644 --- a/SDWebImage/SDWebImageCompat.m +++ b/SDWebImage/SDWebImageCompat.m @@ -10,7 +10,11 @@ #import "UIImage+MultiFormat.h" #if !__has_feature(objc_arc) -#error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag + #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag +#endif + +#if !OS_OBJECT_USE_OBJC + #error SDWebImage need ARC for dispatch object #endif inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { diff --git a/SDWebImage/SDWebImageDownloader.m b/SDWebImage/SDWebImageDownloader.m index 24e5e0d6..07e29d16 100644 --- a/SDWebImage/SDWebImageDownloader.m +++ b/SDWebImage/SDWebImageDownloader.m @@ -21,7 +21,7 @@ @property (strong, nonatomic, nonnull) NSMutableDictionary *URLOperations; @property (strong, nonatomic, nullable) SDHTTPHeadersMutableDictionary *HTTPHeaders; // This queue is used to serialize the handling of the network responses of all the download operation in a single queue -@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t barrierQueue; +@property (strong, nonatomic, nullable) dispatch_queue_t barrierQueue; // The session in which data tasks will run @property (strong, nonatomic) NSURLSession *session; @@ -112,7 +112,6 @@ self.session = nil; [self.downloadQueue cancelAllOperations]; - SDDispatchQueueRelease(_barrierQueue); } - (void)setValue:(nullable NSString *)value forHTTPHeaderField:(nullable NSString *)field { diff --git a/SDWebImage/SDWebImageDownloaderOperation.m b/SDWebImage/SDWebImageDownloaderOperation.m index 479c6b0a..8fdab376 100644 --- a/SDWebImage/SDWebImageDownloaderOperation.m +++ b/SDWebImage/SDWebImageDownloaderOperation.m @@ -38,7 +38,7 @@ typedef NSMutableDictionary SDCallbacksDictionary; @property (strong, nonatomic, readwrite, nullable) NSURLSessionTask *dataTask; -@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t barrierQueue; +@property (strong, nonatomic, nullable) dispatch_queue_t barrierQueue; #if SD_UIKIT @property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundTaskId; @@ -74,10 +74,6 @@ typedef NSMutableDictionary SDCallbacksDictionary; return self; } -- (void)dealloc { - SDDispatchQueueRelease(_barrierQueue); -} - - (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock { SDCallbacksDictionary *callbacks = [NSMutableDictionary new]; diff --git a/SDWebImage/SDWebImagePrefetcher.h b/SDWebImage/SDWebImagePrefetcher.h index c299de17..93357f4e 100644 --- a/SDWebImage/SDWebImagePrefetcher.h +++ b/SDWebImage/SDWebImagePrefetcher.h @@ -61,7 +61,7 @@ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, /** * Queue options for Prefetcher. Defaults to Main Queue. */ -@property (SDDispatchQueueSetterSementics, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; +@property (strong, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; @property (weak, nonatomic, nullable) id delegate;