Remove the out-dated compatible code for non-ARC
This commit is contained in:
parent
efa030cb47
commit
eda6d5d485
|
@ -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<NSString *> *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 {
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
@interface SDWebImageCodersManager ()
|
||||
|
||||
@property (nonatomic, strong, nonnull) NSMutableArray<SDWebImageCoder>* mutableCoders;
|
||||
@property (SDDispatchQueueSetterSementics, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue;
|
||||
@property (strong, nonatomic, nonnull) NSMutableArray<SDWebImageCoder>* 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<SDWebImageCoder>)coder {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -13,6 +13,10 @@
|
|||
#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) {
|
||||
if (!image) {
|
||||
return nil;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
@property (strong, nonatomic, nonnull) NSMutableDictionary<NSURL *, SDWebImageDownloaderOperation *> *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 {
|
||||
|
|
|
@ -38,7 +38,7 @@ typedef NSMutableDictionary<NSString *, id> 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<NSString *, id> SDCallbacksDictionary;
|
|||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc {
|
||||
SDDispatchQueueRelease(_barrierQueue);
|
||||
}
|
||||
|
||||
- (nullable id)addHandlersForProgress:(nullable SDWebImageDownloaderProgressBlock)progressBlock
|
||||
completed:(nullable SDWebImageDownloaderCompletedBlock)completedBlock {
|
||||
SDCallbacksDictionary *callbacks = [NSMutableDictionary new];
|
||||
|
|
|
@ -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 <SDWebImagePrefetcherDelegate> delegate;
|
||||
|
||||
|
|
Loading…
Reference in New Issue