diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-12-20 00:20:40 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2011-12-20 00:20:40 +0000 |
| commit | 437d0991767359c01d354b9a6f73f2c6b1e7c54c (patch) | |
| tree | f8a7116604c8c0c18d1c043adc46fcfc7491f058 | |
| parent | 52dd8ecce8339768bedfb424f9cb233b57cd55f4 (diff) | |
| download | pcsxr-437d0991767359c01d354b9a6f73f2c6b1e7c54c.tar.gz | |
Added sanity checking around the temporary version checking for loading libraries for Mac OS X.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@73526 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | macosx/PcsxrPlugin.m | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/macosx/PcsxrPlugin.m b/macosx/PcsxrPlugin.m index 110d0630..d0b712de 100644 --- a/macosx/PcsxrPlugin.m +++ b/macosx/PcsxrPlugin.m @@ -105,15 +105,20 @@ NSString *fullPath = [plugDir stringByAppendingPathComponent:path]; if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]) { void *tempHandle = SysLoadLibrary([fullPath fileSystemRepresentation]); - PSEgetLibVersion tempLibVersion = SysLoadSym(tempHandle, "PSEgetLibVersion"); - long tempVers2 = tempLibVersion(); - if (tempVers <= tempVers2 ){ - goodPath = fullPath; - tempVers = tempVers2; + if (tempHandle != NULL) + { + PSEgetLibVersion tempLibVersion = SysLoadSym(tempHandle, "PSEgetLibVersion"); + if (SysLibError() == NULL) + { + long tempVers2 = tempLibVersion(); + if (tempVers <= tempVers2 ){ + goodPath = fullPath; + tempVers = tempVers2; + } + } + SysCloseLibrary(tempHandle); } - SysCloseLibrary(tempHandle); } - } pluginRef = SysLoadLibrary([goodPath fileSystemRepresentation]); if (pluginRef == nil) { |
