# HG changeset patch # User koda # Date 1316894051 -7200 # Node ID 24631fd2fb9eb4a22f0f8ca95128a33fa432a285 # Parent 85410eef7ba4f4fda2e8d8602d893573f1eb75f5 better memory cleanup for audiomanager and position of lower stats button diff -r 85410eef7ba4 -r 24631fd2fb9e project_files/HedgewarsMobile/Classes/AudioManagerController.h --- a/project_files/HedgewarsMobile/Classes/AudioManagerController.h Sat Sep 24 14:48:23 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/AudioManagerController.h Sat Sep 24 21:54:11 2011 +0200 @@ -34,6 +34,6 @@ +(void) playBackSound; +(void) playSelectSound; -+(void) didReceiveMemoryWarning; ++(void) cleanupMemory; @end diff -r 85410eef7ba4 -r 24631fd2fb9e project_files/HedgewarsMobile/Classes/AudioManagerController.m --- a/project_files/HedgewarsMobile/Classes/AudioManagerController.m Sat Sep 24 14:48:23 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/AudioManagerController.m Sat Sep 24 21:54:11 2011 +0200 @@ -108,19 +108,13 @@ #pragma mark - #pragma mark memory management -+(void) didReceiveMemoryWarning { ++(void) cleanupMemory { [backgroundMusic stop]; - backgroundMusic = nil; - clickSound = -1; - backSound = -1; -} - -+(void) dealloc { - releaseAndNil(backgroundMusic); + [backgroundMusic release], backgroundMusic = nil; AudioServicesDisposeSystemSoundID(clickSound), clickSound = -1; AudioServicesDisposeSystemSoundID(backSound), backSound = -1; AudioServicesDisposeSystemSoundID(selSound), selSound = -1; - [super dealloc]; + MSG_MEMCLEAN(); } @end diff -r 85410eef7ba4 -r 24631fd2fb9e project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m --- a/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Sat Sep 24 14:48:23 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/HedgewarsAppDelegate.m Sat Sep 24 21:54:11 2011 +0200 @@ -94,7 +94,7 @@ -(void) applicationDidReceiveMemoryWarning:(UIApplication *)application { // don't stop music when it is playing if (self.isInGame) { - [AudioManagerController didReceiveMemoryWarning]; + [AudioManagerController cleanupMemory]; MSG_MEMCLEAN(); } print_free_memory(); diff -r 85410eef7ba4 -r 24631fd2fb9e project_files/HedgewarsMobile/Classes/StatsPageViewController.m --- a/project_files/HedgewarsMobile/Classes/StatsPageViewController.m Sat Sep 24 14:48:23 2011 +0200 +++ b/project_files/HedgewarsMobile/Classes/StatsPageViewController.m Sat Sep 24 21:54:11 2011 +0200 @@ -145,10 +145,10 @@ -(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { if (section == 2) { - UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.tableView.rowHeight)]; + UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.height * 70 / 100, self.tableView.rowHeight)]; footer.autoresizingMask = UIViewAutoresizingFlexibleWidth; - UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.width, self.tableView.rowHeight)]; + UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 17, self.view.frame.size.height * 70 / 100, self.tableView.rowHeight)]; button.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin; [button setTitle:NSLocalizedString(@"Done",@"") forState:UIControlStateNormal]; [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];