cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m
changeset 3361 cfc6cd502f85
parent 3335 2520ee7a5484
child 3365 37ac593e9027
--- a/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m	Mon Apr 19 15:30:11 2010 +0000
+++ b/cocoaTouch/SDLOverrides/SDL_uikitappdelegate.m	Wed Apr 21 01:57:23 2010 +0000
@@ -53,7 +53,7 @@
 }
 
 @implementation SDLUIKitDelegate
-@synthesize uiwindow, window, viewController;
+@synthesize uiwindow, window;
 
 // convenience method
 +(SDLUIKitDelegate *)sharedAppDelegate {
@@ -65,7 +65,7 @@
 	if (self = [super init]){
         self.uiwindow = nil;
         self.window = NULL;
-        self.viewController = nil;
+        viewController = nil;
         isInGame = NO;
         return self;
     } else 
@@ -73,6 +73,7 @@
 }
 
 -(void) dealloc {
+    SDL_DestroyWindow(self.window);
     [viewController release];
 	[uiwindow release];
 	[super dealloc];
@@ -111,16 +112,15 @@
     //[application setStatusBarHidden:YES withAnimation:NO];
     [application setStatusBarHidden:YES];
     [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];  
-		
+    
 	self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
 	self.uiwindow.backgroundColor = [UIColor blackColor];
 	
     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
-        self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil];
+        viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil];
     else
-        self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil];
+        viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil];
 	[uiwindow addSubview:viewController.view];
-    [viewController release];
 	
 	// Set working directory to resource path
 	[[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]];