summary refs log tree commit diff stats
path: root/Classes/HighscoreListController.m
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-09-05 13:03:27 -0400
committerStarla Insigna <starla4444@gmail.com>2011-09-05 13:03:27 -0400
commitbbe409f5e34b5269ecbb7f61dbb8a793e2871d20 (patch)
treeb928d980abca3d1f1747362032061d592478556c /Classes/HighscoreListController.m
parent5af6401805f65a9b5968625d565613dd83edcfc7 (diff)
downloadcartcollect-bbe409f5e34b5269ecbb7f61dbb8a793e2871d20.tar.gz
cartcollect-bbe409f5e34b5269ecbb7f61dbb8a793e2871d20.tar.bz2
cartcollect-bbe409f5e34b5269ecbb7f61dbb8a793e2871d20.zip
Made general memory fixes
This revision should also hopefully fix the undefined behavior GameOverScene bug--if it, I'll reopen the ticket and continue investigating.

Fixes #215
Diffstat (limited to 'Classes/HighscoreListController.m')
-rwxr-xr-xClasses/HighscoreListController.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Classes/HighscoreListController.m b/Classes/HighscoreListController.m index 7dbefa1..7370da5 100755 --- a/Classes/HighscoreListController.m +++ b/Classes/HighscoreListController.m
@@ -22,7 +22,7 @@
22 // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. 22 // Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
23 self = [super initWithStyle:style]; 23 self = [super initWithStyle:style];
24 if (self) { 24 if (self) {
25 localHighscores = [Highscore localHighscoreListForGameMode:@"Collect"]; 25 localHighscores = [[Highscore localHighscoreListForGameMode:@"Collect"] retain];
26 26
27 navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)]; 27 navigationBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
28 myNavigationItem = [[UINavigationItem alloc] initWithTitle:@"Highscores"]; 28 myNavigationItem = [[UINavigationItem alloc] initWithTitle:@"Highscores"];
@@ -48,6 +48,7 @@
48 toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 480-44, 320, 44)]; 48 toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 480-44, 320, 44)];
49 [toolbar setItems:[NSArray arrayWithObjects:barButton3, btnSpace, barButton2, nil] animated:NO]; 49 [toolbar setItems:[NSArray arrayWithObjects:barButton3, btnSpace, barButton2, nil] animated:NO];
50 [barButton2 release]; 50 [barButton2 release];
51 [btnSpace release];
51 [barButton3 release]; 52 [barButton3 release];
52 53
53 showGlobal = NO; 54 showGlobal = NO;
@@ -326,13 +327,16 @@
326 327
327- (void)switchGameMode:(id)sender 328- (void)switchGameMode:(id)sender
328{ 329{
330 [localHighscores release];
331
329 if ([(UISegmentedControl*)sender selectedSegmentIndex] == 0) 332 if ([(UISegmentedControl*)sender selectedSegmentIndex] == 0)
330 { 333 {
331 localHighscores = [Highscore localHighscoreListForGameMode:@"Collect"]; 334 localHighscores = [[Highscore localHighscoreListForGameMode:@"Collect"] retain];
332 } else { 335 } else {
333 localHighscores = [Highscore localHighscoreListForGameMode:@"Jump"]; 336 localHighscores = [[Highscore localHighscoreListForGameMode:@"Jump"] retain];
334 } 337 }
335 338
339 [globalHighscores release];
336 globalHighscores = nil; 340 globalHighscores = nil;
337 341
338 [self switchLists:areaControl]; 342 [self switchLists:areaControl];