Are there any potential memory issues with the following code?:
- (void)viewDidLoad
{
locationManager = [[CLLocationManager alloc] init];
}
- (void)viewWillAppear:(BOOL)animated {
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.distanceFilter = kCLDistanceFilterNone;
[locationManager startUpdatingLocation];
}
- (void)viewDidUnload
{
[locationManager release];
locationManager=nil;
[super viewDidUnload];
}
I have checked it with Instrument and it says there is memory leaking with above code.