project_files/HedgewarsMobile/Classes/MainMenuViewController.m
changeset 3971 5c82ee165ed5
parent 3923 694e6f6e0e30
child 3996 eb549fd864a5
equal deleted inserted replaced
3970:0f6e3219c108 3971:5c82ee165ed5
    31 @implementation MainMenuViewController
    31 @implementation MainMenuViewController
    32 @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController;
    32 @synthesize gameConfigViewController, settingsViewController, aboutViewController, savedGamesViewController;
    33 
    33 
    34 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    34 -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
    35     return rotationManager(interfaceOrientation);
    35     return rotationManager(interfaceOrientation);
    36 }
       
    37 
       
    38 - (void)didReceiveMemoryWarning {
       
    39     // Releases the view if it doesn't have a superview.
       
    40     [super didReceiveMemoryWarning];
       
    41     if (self.settingsViewController.view.superview == nil)
       
    42         self.settingsViewController = nil;
       
    43     if (self.gameConfigViewController.view.superview == nil)
       
    44         self.gameConfigViewController = nil;
       
    45     MSG_MEMCLEAN();
       
    46 }
    36 }
    47 
    37 
    48 // using a different thread for audio 'cos it's slow
    38 // using a different thread for audio 'cos it's slow
    49 -(void) initAudioThread {
    39 -(void) initAudioThread {
    50     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    40     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
   254     self.savedGamesViewController = nil;
   244     self.savedGamesViewController = nil;
   255     MSG_DIDUNLOAD();
   245     MSG_DIDUNLOAD();
   256     [super viewDidUnload];
   246     [super viewDidUnload];
   257 }
   247 }
   258 
   248 
       
   249 -(void) didReceiveMemoryWarning {
       
   250     if (self.settingsViewController.view.superview == nil)
       
   251         self.settingsViewController = nil;
       
   252     if (self.gameConfigViewController.view.superview == nil)
       
   253         self.gameConfigViewController = nil;
       
   254     if (self.aboutViewController.view.superview == nil)
       
   255         self.aboutViewController = nil;
       
   256     if (self.savedGamesViewController.view.superview == nil)
       
   257         self.savedGamesViewController = nil;
       
   258     MSG_MEMCLEAN();
       
   259     [super didReceiveMemoryWarning];
       
   260 }
       
   261 
   259 -(void) dealloc {
   262 -(void) dealloc {
   260     [settingsViewController release];
   263     [settingsViewController release];
   261     [gameConfigViewController release];
   264     [gameConfigViewController release];
   262     [aboutViewController release];
   265     [aboutViewController release];
   263     [savedGamesViewController release];
   266     [savedGamesViewController release];