I'm experiencing a consistent increase in the net number of objects (as determined by Instruments) when I try to do a simple asynchronous url request. Note that I do not see a leak detected visually, but when I look at the number in the "# Net" column, I see the number increasing each time I make a call to a server. I stripped out everything that I could to make the simplest example possible:
In applicationDidFinishLaunching, add
Add an action method linked up to a simple button in the app:
Post.m looks like this:
To test, I click the button (slowly, to ensure a full request has finished) a few times until the allocations in Instruments seem to stabilize. After that point, with each click the # net allocs increases by by a few.
Any ideas on what's causing this? I tried to follow the Apple Doc's example closely (and make it even more simple for the purposes of my debugging and this post).
Thanks,
Rob
In applicationDidFinishLaunching, add
Code:
posty = [[Post alloc] init];
Add an action method linked up to a simple button in the app:
Code:
-(IBAction) clicky:(id)sender {
[posty post];
}
Post.m looks like this:
Code:
-(void) post {
NSURLRequest* req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]];
[theData release];
theData = nil;
theData = [[NSMutableData data] retain];
[[NSURLConnection alloc] initWithRequest:req delegate:self];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[connection release];
}
To test, I click the button (slowly, to ensure a full request has finished) a few times until the allocations in Instruments seem to stabilize. After that point, with each click the # net allocs increases by by a few.
Any ideas on what's causing this? I tried to follow the Apple Doc's example closely (and make it even more simple for the purposes of my debugging and this post).
Thanks,
Rob