forked from organicmaps/organicmaps
[ios] Fixed some memory issues
This commit is contained in:
parent
a8ab311093
commit
911cfcc587
2 changed files with 23 additions and 14 deletions
|
@ -16,11 +16,11 @@
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
self.webView = nil;
|
||||
self.navBar = nil;
|
||||
self.navSearch = nil;
|
||||
self.navArticle = nil;
|
||||
self.pinchGestureRecognizer = nil;
|
||||
[webView release];
|
||||
[navBar release];
|
||||
[navSearch release];
|
||||
[navArticle release];
|
||||
[pinchGestureRecognizer release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -66,8 +66,8 @@
|
|||
self.navBar = [[[UINavigationBar alloc] initWithFrame:navBarFrame] autorelease];
|
||||
self.navBar.delegate = self;
|
||||
self.navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
|
||||
self.navSearch = [[UINavigationItem alloc] initWithTitle:@"Search"];
|
||||
self.navArticle = [[UINavigationItem alloc] initWithTitle:@""];
|
||||
self.navSearch = [[[UINavigationItem alloc] initWithTitle:@"Search"] autorelease];
|
||||
self.navArticle = [[[UINavigationItem alloc] initWithTitle:@""] autorelease];
|
||||
[self.navBar pushNavigationItem:navSearch animated:NO];
|
||||
[self.navBar pushNavigationItem:navArticle animated:NO];
|
||||
|
||||
|
@ -97,6 +97,9 @@
|
|||
|
||||
self.webView = nil;
|
||||
self.navBar = nil;
|
||||
self.navSearch = nil;
|
||||
self.navArticle = nil;
|
||||
self.pinchGestureRecognizer = nil;
|
||||
[super viewDidUnload];
|
||||
}
|
||||
|
||||
|
|
|
@ -29,9 +29,10 @@ struct SloynikData
|
|||
- (void)dealloc
|
||||
{
|
||||
delete m_pSloynikData;
|
||||
self.searchBar = nil;
|
||||
self.resultsView = nil;
|
||||
self.articleVC = nil;
|
||||
[searchBar release];
|
||||
[resultsView release];
|
||||
[articleVC release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -44,11 +45,9 @@ struct SloynikData
|
|||
|
||||
self.resultsView.dataSource = self;
|
||||
self.resultsView.delegate = self;
|
||||
|
||||
LogTimeCounter("StartTime", "SearchVC initializing.");
|
||||
|
||||
m_pSloynikData = new SloynikData;
|
||||
GetSloynikEngine()->Search("", m_pSloynikData->m_SearchResult);
|
||||
LogTimeCounter("StartTime", "SearchVC initialized.");
|
||||
|
||||
[self onEmptySearch];
|
||||
}
|
||||
|
@ -65,6 +64,9 @@ struct SloynikData
|
|||
[super viewDidUnload];
|
||||
// Release any retained subviews of the main view.
|
||||
// e.g. self.myOutlet = nil;
|
||||
self.searchBar = nil;
|
||||
self.resultsView = nil;
|
||||
self.articleVC = nil;
|
||||
}
|
||||
|
||||
- (void)searchBar:(UISearchBar *)sender textDidChange:(NSString *)searchText
|
||||
|
@ -141,7 +143,6 @@ struct SloynikData
|
|||
return nil;
|
||||
}
|
||||
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
||||
{
|
||||
sl::SloynikEngine::WordId const wordId = indexPath.row;
|
||||
|
@ -179,4 +180,9 @@ struct SloynikData
|
|||
self.resultsView.hidden = YES;
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
{
|
||||
return YES; // All orientations are supported.
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Add table
Reference in a new issue