diff --git a/iphone/Maps/Bookmarks/AddSetVC.mm b/iphone/Maps/Bookmarks/AddSetVC.mm index 7392697688..48608ecd4c 100644 --- a/iphone/Maps/Bookmarks/AddSetVC.mm +++ b/iphone/Maps/Bookmarks/AddSetVC.mm @@ -11,7 +11,7 @@ { m_balloon = view; - self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSaveClicked)]; + self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave target:self action:@selector(onSaveClicked)] autorelease]; self.title = NSLocalizedString(@"add_new_set", @"Add New Bookmark Set dialog title"); } return self; diff --git a/iphone/Maps/Settings/CountriesViewController.mm b/iphone/Maps/Settings/CountriesViewController.mm index 10a9674f82..db5605c2dd 100644 --- a/iphone/Maps/Settings/CountriesViewController.mm +++ b/iphone/Maps/Settings/CountriesViewController.mm @@ -327,8 +327,9 @@ UITableViewCell * g_clickedCell = nil; if (s.CountriesCount(index)) { - CountriesViewController * newController = [[CountriesViewController alloc] initWithIndex: index andHeader: cell.textLabel.text]; - [self.navigationController pushViewController:newController animated:YES]; + CountriesViewController * newController = [[CountriesViewController alloc] initWithIndex: index andHeader: cell.textLabel.text]; + [self.navigationController pushViewController:newController animated:YES]; + [newController release]; } else { diff --git a/iphone/Maps/Settings/Preferences.mm b/iphone/Maps/Settings/Preferences.mm index bbeb6d3fbc..6196b8ee9f 100644 --- a/iphone/Maps/Settings/Preferences.mm +++ b/iphone/Maps/Settings/Preferences.mm @@ -42,7 +42,7 @@ else { u = Settings::Foot; - PrefDelegate * d = [[PrefDelegate alloc] init]; + PrefDelegate * d = [[[PrefDelegate alloc] init] autorelease]; d.m_controller = controller; UIAlertView * alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"which_measurement_system", @"Choose measurement on first launch alert - title") message:nil diff --git a/iphone/Maps/main.mm b/iphone/Maps/main.mm index 70663b6e6a..b6f0909466 100644 --- a/iphone/Maps/main.mm +++ b/iphone/Maps/main.mm @@ -23,7 +23,7 @@ int main(int argc, char * argv[]) NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; Dummy * dummy = [[Dummy alloc] autorelease]; - NSThread * thread = [[NSThread alloc] initWithTarget:dummy selector:@selector(dummyThread:) object:nil]; + NSThread * thread = [[[NSThread alloc] initWithTarget:dummy selector:@selector(dummyThread:) object:nil] autorelease]; [thread start]; int retVal = UIApplicationMain(argc, argv, nil, nil);