I've seen from other posts that there are memory leaking issues with UIWebView. However, with the amount of objects that I have leaking, I have to wonder if I'm doing something wrong. 'Leaks' reports about 60 leaks for opening a UIWebView, loading a page and closing (it's the Facebook login page). I've check the stack trace for every one of these objects, and they never touch my code. They're all either in a separate thread (I only use the main thread), or go from 'main' to a bunch of internal methods that are greyed out. Is this expected from UIWebView? I'm running the latest firmware, and I think they would have fixed this by now. I'm seeing this on the device, by the way. I also tried checking for bugs on the apple site, but there's no way to search other than by issue ID..?
Shaun
Here's a capture of the leaks:
Sorry to answer my own question so quickly, but I just found the problem.
If you return NO for the delegate method:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
and then release the UIWebView, it will leak as described above. Returning YES fixes the issue. At least for me, this is happening on all firmware revisions up to now (4.3.3). I am filing a bug with Apple.