I'm running leaks through Instruments on my iPhone app and I'm seeing a lot of leaks that don't appear to be coming from my code.
For example:
NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request
delegate:operation];
operation.urlConnection = connection;
[connection release];
Leaks is telling me that the first line is leaking 1008 bytes. That seems to be a pretty standard alloc init with a release. Other leaks that are mentioned are in UIKit and WebKit.
Is it possible that these leaks are in fact in Apple's frameworks, or is more likely my code and leaks isn't showing the information accurately?
It's entirely possible that Apple's frameworks have leaks in them (however unlikely it may seem) - there were several in the Core Data implementation for iPhone in the 3.0 GM release.
What you should do when you suspect such a thing is try to find a sample project from Apple that uses the functionality you're looking at or reduce your own code as much as possible (maybe build a minimal side project), then test that with Instruments. If you can reproduce the leak reliably, submit a bug to Apple.
Are you running with NSZombieEnabled? That will cause fake "leaks" to show up in Instruments.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With