summaryrefslogtreecommitdiff
path: root/macosx/PcsxrMemCardArray.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/PcsxrMemCardArray.m')
-rw-r--r--macosx/PcsxrMemCardArray.m11
1 files changed, 7 insertions, 4 deletions
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];