Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Commit

Permalink
Fix potential memory leak of the test connection.
Browse files Browse the repository at this point in the history
  • Loading branch information
jum committed Nov 22, 2011
1 parent f042c50 commit 99dce13
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Appirater.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ - (BOOL)connectedToNetwork {
NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0]; NSURLRequest *testRequest = [NSURLRequest requestWithURL:testURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:20.0];
NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:self]; NSURLConnection *testConnection = [[NSURLConnection alloc] initWithRequest:testRequest delegate:self];


return ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO; BOOL ret = ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO;
[testConnection release];
return ret;
} }


+ (Appirater*)sharedInstance { + (Appirater*)sharedInstance {
Expand Down

0 comments on commit 99dce13

Please sign in to comment.