project_files/HedgewarsMobile/Classes/OverlayViewController.m
changeset 4861 91f889289a47
parent 4856 dbc256913b35
child 4920 bc3c077e15a2
--- a/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Thu Jan 20 01:27:51 2011 +0100
+++ b/project_files/HedgewarsMobile/Classes/OverlayViewController.m	Thu Jan 20 01:49:20 2011 +0100
@@ -186,11 +186,6 @@
                                                  name:@"show help ingame"
                                                object:nil];
 
-    [[NSNotificationCenter defaultCenter] addObserver:self
-                                             selector:@selector(cleanup)
-                                                 name:@"remove overlay"
-                                               object:nil];
-
     // for iOS >= 3.2
     if ([UIScreen respondsToSelector:@selector(screens)]) {
         [[NSNotificationCenter defaultCenter] addObserver:self
@@ -235,7 +230,7 @@
                                               otherButtonTitles:nil];
         [alert show];
         [alert release];
-        [self cleanup];
+        HW_terminate(NO);
     }
 }
 
@@ -257,13 +252,6 @@
     doNotDim();
 }
 
--(void) cleanup {
-    [self dismissPopover];
-    setGameRunning(NO);
-    HW_terminate(NO);
-    [self.view removeFromSuperview];
-}
-
 -(void) didReceiveMemoryWarning {
     if (self.popupMenu.view.superview == nil)
         self.popupMenu = nil;
@@ -457,7 +445,7 @@
 // present a further check before closing game
 -(void) actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger) buttonIndex {
     if ([actionSheet cancelButtonIndex] != buttonIndex)
-        [self cleanup];
+        HW_terminate(NO);
     else
         HW_pause();
 }