diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-09 01:50:38 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-01-09 01:50:38 +0000 |
| commit | 9af085242bda9ad4da78ef23e9d4ed180aa2c629 (patch) | |
| tree | c776a5dfefbe475936a461b54d469d244df9de75 /macosx/PcsxrPlugin.m | |
| parent | c5b4bf6974fbfd05b6e75c494d11569756034e36 (diff) | |
| download | pcsxr-9af085242bda9ad4da78ef23e9d4ed180aa2c629.tar.gz | |
Use ARC in 64-bit mode on the Mac.
Register when we drag a disc image (or double click) to Pcsxr in the recent menu.
Comment out ReleasePlugins() in SysClose: it was causing a pointer to be released twice when you changed a plug-in (specifically, the GPU).
Cleaning up the Recent items code. One notable case is only releasing objects we have ownership of (this is pointless in ARC, but necessary in 32-bit code).
Had to rewrite -[PluginList setActivePlugin:forType:] because the previous version wasn't ARC-friendly.
If we select a disc while the emulator is running, load the disc into the current session.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@82136 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrPlugin.m')
| -rwxr-xr-x | macosx/PcsxrPlugin.m | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/macosx/PcsxrPlugin.m b/macosx/PcsxrPlugin.m index 7c010ef1..b7ecd5d6 100755 --- a/macosx/PcsxrPlugin.m +++ b/macosx/PcsxrPlugin.m @@ -10,6 +10,7 @@ #import "PcsxrPlugin.h" #include "psxcommon.h" #include "plugins.h" +#import "ARCBridge.h" @implementation PcsxrPlugin @@ -129,13 +130,13 @@ } if (goodPath == nil) { - [self release]; + RELEASEOBJ(self); return nil; } pluginRef = SysLoadLibrary([goodPath fileSystemRepresentation]); if (pluginRef == nil) { - [self release]; + RELEASEOBJ(self); return nil; } @@ -153,13 +154,13 @@ else if (([path rangeOfString: @"net" options:NSCaseInsensitiveSearch]).length != 0) type = PSE_LT_NET; else { - [self release]; + RELEASEOBJ(self); return nil; } } else { type = (int)PSE_getLibType(); if (type != PSE_LT_GPU && type != PSE_LT_CDR && type != PSE_LT_SPU && type != PSE_LT_PAD && type != PSE_LT_NET) { - [self release]; + RELEASEOBJ(self); return nil; } } @@ -178,8 +179,8 @@ // save the current modification date NSDictionary *fattrs = [[NSFileManager defaultManager] attributesOfItemAtPath:[goodPath stringByResolvingSymlinksInPath] error:NULL]; - modDate = [[fattrs fileModificationDate] retain]; - fullPlugPath = [goodPath retain]; + modDate = RETAINOBJ([fattrs fileModificationDate]); + fullPlugPath = RETAINOBJ(goodPath); active = 0; @@ -199,30 +200,30 @@ if (pluginRef) SysCloseLibrary(pluginRef); - [modDate release]; - [path release]; - [name release]; - [fullPlugPath release]; + RELEASEOBJ(modDate); + RELEASEOBJ(path); + RELEASEOBJ(name); + RELEASEOBJ(fullPlugPath); - [super dealloc]; + SUPERDEALLOC; } - (void)runCommand:(id)arg { - NSAutoreleasePool *pool = [NSAutoreleasePool new]; - NSString *funcName = [arg objectAtIndex:0]; - long (*func)(void); - - func = SysLoadSym(pluginRef, [funcName cStringUsingEncoding:NSASCIIStringEncoding]); - if (SysLibError() == nil) { - func(); - } else { - NSBeep(); + @autoreleasepool { + NSString *funcName = [arg objectAtIndex:0]; + long (*func)(void); + + func = SysLoadSym(pluginRef, [funcName cStringUsingEncoding:NSASCIIStringEncoding]); + if (SysLibError() == nil) { + func(); + } else { + NSBeep(); + } + + RELEASEOBJ(arg); + return; } - - [arg release]; - [pool drain]; - return; } - (long)runAs:(int)aType |
