Use the correct setter sementics for dispatch (fix 213)

This commit is contained in:
Olivier Poitrey 2012-11-06 17:14:20 +01:00
parent 541f3a1284
commit 1f0a8f4b13
3 changed files with 15 additions and 4 deletions

View File

@ -19,7 +19,7 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
@property (strong, nonatomic) NSCache *memCache; @property (strong, nonatomic) NSCache *memCache;
@property (strong, nonatomic) NSString *diskCachePath; @property (strong, nonatomic) NSString *diskCachePath;
@property (assign, nonatomic) dispatch_queue_t ioQueue; @property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t ioQueue;
@end @end

View File

@ -35,17 +35,28 @@
// @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f // @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f
#define SDDispatchQueueRelease(q) (dispatch_release(q)) #define SDDispatchQueueRelease(q) (dispatch_release(q))
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 #if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
#undef SDDispatchQueueRelease
#define SDDispatchQueueRelease(q) #define SDDispatchQueueRelease(q)
#undef SDDispatchQueueSetterSementics
#define SDDispatchQueueSetterSementics strong
#endif #endif
#else #else
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
#undef SDDispatchQueueRelease
#define SDDispatchQueueRelease(q) #define SDDispatchQueueRelease(q)
#undef SDDispatchQueueSetterSementics
#define SDDispatchQueueSetterSementics strong
#endif #endif
#endif #endif
#if OS_OBJECT_USE_OBJC
#define SDDispatchQueueSetterSementics strong
#else
#define SDDispatchQueueSetterSementics assign
#endif
NS_INLINE UIImage *SDScaledImageForPath(NSString *path, NSObject *imageOrData) NS_INLINE UIImage *SDScaledImageForPath(NSString *path, NSObject *imageOrData)
{ {
if (!imageOrData) if (!imageOrData)

View File

@ -21,8 +21,8 @@ NSString *const kCompletedCallbackKey = @"completed";
@property (strong, nonatomic) NSOperationQueue *downloadQueue; @property (strong, nonatomic) NSOperationQueue *downloadQueue;
@property (strong, nonatomic) NSMutableDictionary *URLCallbacks; @property (strong, nonatomic) NSMutableDictionary *URLCallbacks;
// This queue is used to serialize the handling of the network responses of all the download operation in a single queue // This queue is used to serialize the handling of the network responses of all the download operation in a single queue
@property (assign, nonatomic) dispatch_queue_t workingQueue; @property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t workingQueue;
@property (assign, nonatomic) dispatch_queue_t barrierQueue; @property (SDDispatchQueueSetterSementics, nonatomic) dispatch_queue_t barrierQueue;
@end @end