views:

73

answers:

1

Hi there,

I am having problem finding a memory leak with Instruments. Usually it helps me a lot and I am able to find the leak, but in this case I'm lost.

I am creating a view controller that controls a views loaded from NIB file. The view has Map View with "Show user location" on true. Once user location is found I use MKReverseGeocoder to get the location data. The leak is always present when I load this view controller and MapKit finds user location. I figured out that MKReverseGeocoder isn't problem here, since I get the same leak with or without the MKReverseGeocoder.

When I load this view Instruments "leaks" report a memory leak. See the screenshot on the image: alt text

This is how I initialize my controller:

AddPlaceViewController *addPlaceVC = [[AddPlaceViewController alloc] initWithNibName:@"AddPlaceViewController" bundle:[NSBundle mainBundle]];
addPlaceVC.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addPlaceVC];
self.placeController = navigationController;
[self presentModalViewController:self.placeController animated:YES];
[addPlaceVC release];
[navigationController release];

This is all on the iPhone Simulator 4 and targeted OS 3.2.

Is this actually leak or what I am facing here?

+1  A: 

Since the responsible library is "Foundation" and not your code, there is nothing you can do about it (except report it to Apple).

Ole Begemann
IS this true? I've had similar issues when using Instruments reports leaks in Apple APIs. I always tend to think that I'm misinterpreting or reading the report wrong because why would Apple release leaky code? ;) But seriously, is it common that Apple APIs leak or cause leaks?
Cliff
There are two possibilities: (1) Apple indeed writes leaky code; (2) Instruments reports false positives. We can't do anything about either.
Ole Begemann