Rather than crashing, just disable the plugin if we an't load the dll

This commit is contained in:
endolf 2007-09-22 19:35:06 +00:00
parent 13e1269023
commit 69a2984615
2 changed files with 20 additions and 10 deletions

View file

@ -67,11 +67,16 @@ public final class DirectInputEnvironmentPlugin extends ControllerEnvironment im
AccessController.doPrivileged(
new PrivilegedAction() {
public final Object run() {
String lib_path = System.getProperty("net.java.games.input.librarypath");
if (lib_path != null)
System.load(lib_path + File.separator + System.mapLibraryName(lib_name));
else
System.loadLibrary(lib_name);
try {
String lib_path = System.getProperty("net.java.games.input.librarypath");
if (lib_path != null)
System.load(lib_path + File.separator + System.mapLibraryName(lib_name));
else
System.loadLibrary(lib_name);
} catch (UnsatisfiedLinkError e) {
e.printStackTrace();
supported = false;
}
return null;
}
});

View file

@ -67,11 +67,16 @@ public final class RawInputEnvironmentPlugin extends ControllerEnvironment imple
AccessController.doPrivileged(
new PrivilegedAction() {
public final Object run() {
String lib_path = System.getProperty("net.java.games.input.librarypath");
if (lib_path != null)
System.load(lib_path + File.separator + System.mapLibraryName(lib_name));
else
System.loadLibrary(lib_name);
try {
String lib_path = System.getProperty("net.java.games.input.librarypath");
if (lib_path != null)
System.load(lib_path + File.separator + System.mapLibraryName(lib_name));
else
System.loadLibrary(lib_name);
} catch (UnsatisfiedLinkError e) {
e.printStackTrace();
supported = false;
}
return null;
}
});