Merge pull request #224 from kcharwood/url-cancel-fix

Added in cancel changes based on @zdzisiekpu's recommendation
This commit is contained in:
Mattt Thompson 2012-03-01 08:41:55 -08:00
commit ed7ed7af4a

View file

@ -85,7 +85,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
@interface AFURLConnectionOperation () @interface AFURLConnectionOperation ()
@property (readwrite, nonatomic, assign) AFOperationState state; @property (readwrite, nonatomic, assign) AFOperationState state;
@property (readwrite, nonatomic, retain) NSRecursiveLock *lock; @property (readwrite, nonatomic, retain) NSRecursiveLock *lock;
@property (readwrite, nonatomic, assign) NSURLConnection *connection; @property (readwrite, nonatomic, retain) NSURLConnection *connection;
@property (readwrite, nonatomic, retain) NSURLRequest *request; @property (readwrite, nonatomic, retain) NSURLRequest *request;
@property (readwrite, nonatomic, retain) NSURLResponse *response; @property (readwrite, nonatomic, retain) NSURLResponse *response;
@property (readwrite, nonatomic, retain) NSError *error; @property (readwrite, nonatomic, retain) NSError *error;
@ -192,6 +192,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
[_authenticationChallenge release]; [_authenticationChallenge release];
[_authenticationAgainstProtectionSpace release]; [_authenticationAgainstProtectionSpace release];
[_connection release];
[super dealloc]; [super dealloc];
} }
@ -466,6 +468,8 @@ didReceiveResponse:(NSURLResponse *)response
} }
[self finish]; [self finish];
self.connection = nil;
} }
- (void)connection:(NSURLConnection *)__unused connection - (void)connection:(NSURLConnection *)__unused connection
@ -480,6 +484,8 @@ didReceiveResponse:(NSURLResponse *)response
} }
[self finish]; [self finish];
self.connection = nil;
} }
- (NSCachedURLResponse *)connection:(NSURLConnection *)__unused connection - (NSCachedURLResponse *)connection:(NSURLConnection *)__unused connection