Skip to content

Instantly share code, notes, and snippets.

@bogardon
Created April 6, 2012 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogardon/2323766 to your computer and use it in GitHub Desktop.
Save bogardon/2323766 to your computer and use it in GitHub Desktop.
NSCachedURLResponse data leak
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.organicshoppermag.com/assets/images/miso_img_large.gif"]];
NSURLResponse *response = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL];
NSCachedURLResponse *cachedResponse = [[[NSCachedURLResponse alloc] initWithResponse:response data:data] autorelease];
NSLog(@"%u",cachedResponse.data.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment