diff options
author | endolf <[email protected]> | 2007-09-22 19:35:06 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2007-09-22 19:35:06 +0000 |
commit | 3bd41b2cac897ea842291e0b792c9f0124b857a6 (patch) | |
tree | 4dfa42eabcea1a9b52c399f5f617cceaa2d238ee | |
parent | 871a52545a3873c9ebfce00e7d417d86c60ebfe1 (diff) |
Rather than crashing, just disable the plugin if we an't load the dll
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@206 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rw-r--r-- | plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java | 15 | ||||
-rw-r--r-- | plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java | 15 |
2 files changed, 20 insertions, 10 deletions
diff --git a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java index 5e31bad..4e5e742 100644 --- a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java +++ b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java @@ -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; } }); diff --git a/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java index 767d461..fe76215 100644 --- a/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java +++ b/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java @@ -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; } }); |