Shave a bit of time off the end of the request by invalidating the timer and sto…
…pping the runloop when done Make readStream non-atomic
Showing
1 changed file
with
5 additions
and
3 deletions
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | #import "ASIInputStream.h" | 21 | #import "ASIInputStream.h" |
| 22 | 22 | ||
| 23 | // Automatically set on build | 23 | // Automatically set on build |
| 24 | -NSString *ASIHTTPRequestVersion = @"v1.2-67 2010-01-05"; | 24 | +NSString *ASIHTTPRequestVersion = @"v1.2-68 2010-01-06"; |
| 25 | 25 | ||
| 26 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; | 26 | NSString* const NetworkRequestErrorDomain = @"ASIHTTPRequestErrorDomain"; |
| 27 | 27 | ||
| @@ -173,7 +173,7 @@ static BOOL isiPhoneOS2; | @@ -173,7 +173,7 @@ static BOOL isiPhoneOS2; | ||
| 173 | @property (assign) int retryCount; | 173 | @property (assign) int retryCount; |
| 174 | @property (assign) BOOL canUsePersistentConnection; | 174 | @property (assign) BOOL canUsePersistentConnection; |
| 175 | @property (retain, nonatomic) NSMutableDictionary *connectionInfo; | 175 | @property (retain, nonatomic) NSMutableDictionary *connectionInfo; |
| 176 | -@property (retain) NSInputStream *readStream; | 176 | +@property (retain, nonatomic) NSInputStream *readStream; |
| 177 | @property (assign) ASIAuthenticationState authenticationNeeded; | 177 | @property (assign) ASIAuthenticationState authenticationNeeded; |
| 178 | @property (assign, nonatomic) BOOL readStreamIsScheduled; | 178 | @property (assign, nonatomic) BOOL readStreamIsScheduled; |
| 179 | @property (retain, nonatomic) NSTimer *statusTimer; | 179 | @property (retain, nonatomic) NSTimer *statusTimer; |
| @@ -2531,7 +2531,9 @@ static BOOL isiPhoneOS2; | @@ -2531,7 +2531,9 @@ static BOOL isiPhoneOS2; | ||
| 2531 | [self willChangeValueForKey:@"isFinished"]; | 2531 | [self willChangeValueForKey:@"isFinished"]; |
| 2532 | [self didChangeValueForKey:@"isFinished"]; | 2532 | [self didChangeValueForKey:@"isFinished"]; |
| 2533 | [self setInProgress:NO]; | 2533 | [self setInProgress:NO]; |
| 2534 | - // We leave stopping the runloop to the timer, since it needs to clean itself up first or we'll leak | 2534 | + CFRunLoopStop(CFRunLoopGetCurrent()); |
| 2535 | + [self setStatusTimer:nil]; | ||
| 2536 | + | ||
| 2535 | } | 2537 | } |
| 2536 | 2538 | ||
| 2537 | 2539 |
-
Please register or login to post a comment