From 09b52df12a0dc938bdd9b4c2d36a1d13af88ca50 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Wed, 10 Jul 2013 00:04:59 +0000 Subject: minor code tweaks. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85949 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/PcsxrMemCardArray.m | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'macosx/PcsxrMemCardArray.m') diff --git a/macosx/PcsxrMemCardArray.m b/macosx/PcsxrMemCardArray.m index 10921030..c12f50dd 100644 --- a/macosx/PcsxrMemCardArray.m +++ b/macosx/PcsxrMemCardArray.m @@ -101,7 +101,7 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) i = 0; while (i < MAX_MEMCARD_BLOCKS) { x = 1; - McdBlock memBlock, tmpBlock; + McdBlock memBlock; GetMcdBlockInfo(carNum, i + 1, &memBlock); if ([PcsxrMemoryObject memFlagsFromBlockFlags:memBlock.Flags] == memFlagFree) { @@ -110,6 +110,7 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) continue; } do { + McdBlock tmpBlock; GetMcdBlockInfo(carNum, i + x + 1, &tmpBlock); if ((tmpBlock.Flags & 0x3) == 0x3) { x++; @@ -120,9 +121,11 @@ static inline void ClearMemcardData(char *to, int dsti, char *str) break; } } while (i + x - 1 < MAX_MEMCARD_BLOCKS); - PcsxrMemoryObject *obj = [[PcsxrMemoryObject alloc] initWithMcdBlock:&memBlock startingIndex:i size:x]; - [tmpMemArray addObject:obj]; - RELEASEOBJ(obj); + @autoreleasepool { + PcsxrMemoryObject *obj = [[PcsxrMemoryObject alloc] initWithMcdBlock:&memBlock startingIndex:i size:x]; + [tmpMemArray addObject:obj]; + RELEASEOBJ(obj); + } i += x; } self.rawArray = [NSArray arrayWithArray:tmpMemArray]; -- cgit v1.2.3