Merge branch 'master' of https://github.com/benoitb/AFNetworking into benoitb-master
This commit is contained in:
commit
f12c163df9
2 changed files with 49 additions and 3 deletions
|
|
@ -40,6 +40,22 @@
|
||||||
#import <netdb.h>
|
#import <netdb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Does ARC support support GCD objects?
|
||||||
|
// It does if the minimum deployment target is iOS 6+ or Mac OS X 8+
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
|
||||||
|
#else // iOS 5.X or earlier
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 1
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
|
||||||
|
#else
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
@interface AFMultipartFormData : NSObject <AFMultipartFormData>
|
@interface AFMultipartFormData : NSObject <AFMultipartFormData>
|
||||||
|
|
||||||
- (id)initWithURLRequest:(NSMutableURLRequest *)request
|
- (id)initWithURLRequest:(NSMutableURLRequest *)request
|
||||||
|
|
@ -547,7 +563,9 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
completionBlock(operations);
|
completionBlock(operations);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
dispatch_release(dispatchGroup);
|
dispatch_release(dispatchGroup);
|
||||||
|
#endif
|
||||||
}];
|
}];
|
||||||
|
|
||||||
for (AFHTTPRequestOperation *operation in operations) {
|
for (AFHTTPRequestOperation *operation in operations) {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,22 @@
|
||||||
#define AF_CAST_TO_BLOCK __bridge void *
|
#define AF_CAST_TO_BLOCK __bridge void *
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Does ARC support support GCD objects?
|
||||||
|
// It does if the minimum deployment target is iOS 6+ or Mac OS X 8+
|
||||||
|
#if TARGET_OS_IPHONE
|
||||||
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
|
||||||
|
#else // iOS 5.X or earlier
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 1
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
|
||||||
|
#else
|
||||||
|
#define NEEDS_DISPATCH_RETAIN_RELEASE 1 // Mac OS X 10.7 or earlier
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
NSSet * AFContentTypesFromHTTPHeader(NSString *string) {
|
NSSet * AFContentTypesFromHTTPHeader(NSString *string) {
|
||||||
static NSCharacterSet *_skippedCharacterSet = nil;
|
static NSCharacterSet *_skippedCharacterSet = nil;
|
||||||
static dispatch_once_t onceToken;
|
static dispatch_once_t onceToken;
|
||||||
|
|
@ -117,13 +133,17 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
||||||
@dynamic response;
|
@dynamic response;
|
||||||
|
|
||||||
- (void)dealloc {
|
- (void)dealloc {
|
||||||
if (_successCallbackQueue) {
|
if (_successCallbackQueue) {
|
||||||
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
dispatch_release(_successCallbackQueue);
|
dispatch_release(_successCallbackQueue);
|
||||||
|
#endif
|
||||||
_successCallbackQueue = NULL;
|
_successCallbackQueue = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_failureCallbackQueue) {
|
if (_failureCallbackQueue) {
|
||||||
dispatch_release(_failureCallbackQueue);
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
|
dispatch_release(_failureCallbackQueue);
|
||||||
|
#endif
|
||||||
_failureCallbackQueue = NULL;
|
_failureCallbackQueue = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -204,12 +224,16 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
||||||
- (void)setSuccessCallbackQueue:(dispatch_queue_t)successCallbackQueue {
|
- (void)setSuccessCallbackQueue:(dispatch_queue_t)successCallbackQueue {
|
||||||
if (successCallbackQueue != _successCallbackQueue) {
|
if (successCallbackQueue != _successCallbackQueue) {
|
||||||
if (_successCallbackQueue) {
|
if (_successCallbackQueue) {
|
||||||
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
dispatch_release(_successCallbackQueue);
|
dispatch_release(_successCallbackQueue);
|
||||||
|
#endif
|
||||||
_successCallbackQueue = NULL;
|
_successCallbackQueue = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (successCallbackQueue) {
|
if (successCallbackQueue) {
|
||||||
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
dispatch_retain(successCallbackQueue);
|
dispatch_retain(successCallbackQueue);
|
||||||
|
#endif
|
||||||
_successCallbackQueue = successCallbackQueue;
|
_successCallbackQueue = successCallbackQueue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -218,12 +242,16 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
||||||
- (void)setFailureCallbackQueue:(dispatch_queue_t)failureCallbackQueue {
|
- (void)setFailureCallbackQueue:(dispatch_queue_t)failureCallbackQueue {
|
||||||
if (failureCallbackQueue != _failureCallbackQueue) {
|
if (failureCallbackQueue != _failureCallbackQueue) {
|
||||||
if (_failureCallbackQueue) {
|
if (_failureCallbackQueue) {
|
||||||
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
dispatch_release(_failureCallbackQueue);
|
dispatch_release(_failureCallbackQueue);
|
||||||
|
#endif
|
||||||
_failureCallbackQueue = NULL;
|
_failureCallbackQueue = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (failureCallbackQueue) {
|
if (failureCallbackQueue) {
|
||||||
|
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||||
dispatch_retain(failureCallbackQueue);
|
dispatch_retain(failureCallbackQueue);
|
||||||
|
#endif
|
||||||
_failureCallbackQueue = failureCallbackQueue;
|
_failureCallbackQueue = failureCallbackQueue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue