Permalink
Browse files

Fix memory leak on non-released NSURLConnection

  • Loading branch information...
1 parent fb76ded commit aed4690c4e8328c7d61180ca1794cc9580e62720 @a2 a2 committed Oct 1, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 Appirater.m
View
2 Appirater.m
@@ -205,7 +205,7 @@ - (BOOL)connectedToNetwork {
NSURL *testURL = [NSURL URLWithString:@"http://www.apple.com/"];
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] autorelease];
return ((isReachable && !needsConnection) || nonWiFi) ? (testConnection ? YES : NO) : NO;
}

0 comments on commit aed4690

Please sign in to comment.