# HG changeset patch # User koda # Date 1314524304 -7200 # Node ID 972bf04d4a79a8122c6145e28188b0f2679d0963 # Parent f1015857deb8fb26251e2bfe406f30df962d071a ios: fix a couple of bad memory management (unrelated to the crash at the end of each game) sdl13: fixed compilation diff -r f1015857deb8 -r 972bf04d4a79 hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sat Aug 27 17:53:35 2011 -0400 +++ b/hedgewars/uStore.pas Sun Aug 28 11:38:24 2011 +0200 @@ -1006,7 +1006,7 @@ flags:= flags or SDL_WINDOW_BORDERLESS or SDL_WINDOW_RESIZABLE; {$ENDIF} - if cFullScreen then SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags); + if cFullScreen then SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cOrigScreenWidth, cOrigScreenHeight, flags or SDL_WINDOW_FULLSCREEN) else SDLwindow:= SDL_CreateWindow('Hedgewars', x, y, cScreenWidth, cScreenHeight, flags); SDLTry(SDLwindow <> nil, true); {$ELSE} diff -r f1015857deb8 -r 972bf04d4a79 project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h Sat Aug 27 17:53:35 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.h Sun Aug 28 11:38:24 2011 +0200 @@ -38,7 +38,7 @@ TGameType gameType; } -@property (nonatomic,retain) UIViewController *parentController; +@property (assign) UIViewController *parentController; @property (nonatomic,retain) NSString *savePath; @property (nonatomic,retain) OverlayViewController *overlayController; diff -r f1015857deb8 -r 972bf04d4a79 project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m --- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Sat Aug 27 17:53:35 2011 -0400 +++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Sun Aug 28 11:38:24 2011 +0200 @@ -45,7 +45,6 @@ } -(void) dealloc { - releaseAndNil(parentController); releaseAndNil(engineProtocol); releaseAndNil(savePath); releaseAndNil(overlayController); @@ -178,10 +177,6 @@ // warn our host that it's going to be visible again [self.parentController viewWillAppear:YES]; - // release the network manager and the savepath as they are not needed anymore - releaseAndNil(self.engineProtocol); - releaseAndNil(self.savePath); - if ([[userDefaults objectForKey:@"music"] boolValue]) [HedgewarsAppDelegate playBackgroundMusic]; } @@ -192,8 +187,10 @@ NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; [outputFormatter setDateFormat:@"yyyy-MM-dd '@' HH.mm"]; - self.savePath = [[NSString alloc] initWithFormat:@"%@%@.hws",SAVES_DIRECTORY(),[outputFormatter stringFromDate:[NSDate date]]]; + NSString *path = [[NSString alloc] initWithFormat:@"%@%@.hws",SAVES_DIRECTORY(),[outputFormatter stringFromDate:[NSDate date]]]; [outputFormatter release]; + self.savePath = path; + [path release]; // in the rare case in which a savefile with the same name exists the older one must be removed (or it gets corrupted) if ([[NSFileManager defaultManager] fileExistsAtPath:self.savePath]) @@ -206,7 +203,7 @@ // set up variables for a save game -(void) startSaveGame:(NSString *)atPath { self.gameType = gtSave; - self.savePath = [atPath retain]; + self.savePath = atPath; [self.engineProtocol spawnThread:self.savePath]; [self prepareEngineLaunch];