Fix crash under iOS 6 when dispatch_release is called (see #213)
This commit is contained in:
parent
651d8ff583
commit
cceb56353c
|
@ -91,7 +91,7 @@ static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week
|
|||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
dispatch_release(_ioQueue);
|
||||
SDDispatchQueueRelease(_ioQueue);
|
||||
}
|
||||
|
||||
#pragma mark SDImageCache (private)
|
||||
|
|
|
@ -33,6 +33,19 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#endif
|
||||
|
||||
// @see https://github.com/ccgus/fmdb/commit/aef763eeb64e6fa654e7d121f1df4c16a98d9f4f
|
||||
#define SDDispatchQueueRelease(q) (dispatch_release(q))
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000
|
||||
#define SDDispatchQueueRelease(q)
|
||||
#endif
|
||||
#else
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
|
||||
#define SDDispatchQueueRelease(q)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
NS_INLINE UIImage *SDScaledImageForPath(NSString *path, NSObject *imageOrData)
|
||||
{
|
||||
if (!imageOrData)
|
||||
|
|
|
@ -77,8 +77,8 @@ NSString *const kCompletedCallbackKey = @"completed";
|
|||
- (void)dealloc
|
||||
{
|
||||
[self.downloadQueue cancelAllOperations];
|
||||
dispatch_release(_workingQueue);
|
||||
dispatch_release(_barrierQueue);
|
||||
SDDispatchQueueRelease(_workingQueue);
|
||||
SDDispatchQueueRelease(_barrierQueue);
|
||||
}
|
||||
|
||||
- (void)setMaxConcurrentDownloads:(NSInteger)maxConcurrentDownloads
|
||||
|
|
Loading…
Reference in New Issue