Fixing memory leaks found by static analyzer
This commit is contained in:
parent
dffe257063
commit
d94d27dea7
3 changed files with 5 additions and 5 deletions
|
|
@ -82,7 +82,7 @@ static NSOperationQueue *_operationQueue = nil;
|
||||||
|
|
||||||
+ (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {
|
+ (NSMutableURLRequest *)requestWithMethod:(NSString *)method path:(NSString *)path parameters:(NSDictionary *)parameters {
|
||||||
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
|
NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease];
|
||||||
NSMutableDictionary *headers = [_defaultHeaders mutableCopy];
|
NSMutableDictionary *headers = [NSMutableDictionary dictionaryWithDictionary:_defaultHeaders];
|
||||||
NSURL *url = nil;
|
NSURL *url = nil;
|
||||||
|
|
||||||
NSMutableArray *mutableParameterComponents = [NSMutableArray array];
|
NSMutableArray *mutableParameterComponents = [NSMutableArray array];
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ NSString * const AFHTTPOperationParsedDataErrorKey = @"com.alamofire.http-operat
|
||||||
[userInfo setValue:[[self.lastRequest URL] absoluteString] forKey:NSURLErrorFailingURLStringErrorKey];
|
[userInfo setValue:[[self.lastRequest URL] absoluteString] forKey:NSURLErrorFailingURLStringErrorKey];
|
||||||
[userInfo setValue:data forKey:AFHTTPOperationParsedDataErrorKey];
|
[userInfo setValue:data forKey:AFHTTPOperationParsedDataErrorKey];
|
||||||
|
|
||||||
error = [[NSError alloc] initWithDomain:NSURLErrorDomain code:[self.lastResponse statusCode] userInfo:userInfo];
|
error = [[[NSError alloc] initWithDomain:NSURLErrorDomain code:[self.lastResponse statusCode] userInfo:userInfo] autorelease];
|
||||||
|
|
||||||
if (self.callback.errorBlock) {
|
if (self.callback.errorBlock) {
|
||||||
self.callback.errorBlock(self.lastRequest, self.lastResponse, error);
|
self.callback.errorBlock(self.lastRequest, self.lastResponse, error);
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ static inline CGSize kAFImageRequestRoundedCornerRadii(CGSize imageSize) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@implementation AFImageRequestOperation
|
@implementation AFImageRequestOperation
|
||||||
@synthesize callback;
|
@synthesize callback = _callback;
|
||||||
|
|
||||||
- (id)initWithRequest:(NSURLRequest *)someRequest callback:(AFImageRequestOperationCallback *)someCallback {
|
- (id)initWithRequest:(NSURLRequest *)someRequest callback:(AFImageRequestOperationCallback *)someCallback {
|
||||||
self = [super initWithRequest:someRequest];
|
self = [super initWithRequest:someRequest];
|
||||||
|
|
@ -74,8 +74,8 @@ static inline CGSize kAFImageRequestRoundedCornerRadii(CGSize imageSize) {
|
||||||
[super finishWithError:error];
|
[super finishWithError:error];
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
if (callback.errorBlock) {
|
if (self.callback.errorBlock) {
|
||||||
callback.errorBlock(error);
|
self.callback.errorBlock(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue