aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/linux/src/java
diff options
context:
space:
mode:
authorendolf <[email protected]>2006-01-12 22:16:10 +0000
committerendolf <[email protected]>2006-01-12 22:16:10 +0000
commit09bdd72a93f2a5498137d22540d035df87cff174 (patch)
treee6a223eaf343e0fd723a78be2688df16c3bf3112 /plugins/linux/src/java
parent133e7f43a01e4c2423e68a0f3f1e946818bb2bda (diff)
Trying to sort out some of the crashes and failed exits
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@134 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/linux/src/java')
-rw-r--r--plugins/linux/src/java/net/java/games/input/JInputLibrary.java5
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxDeviceRumbler.java10
2 files changed, 4 insertions, 11 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/JInputLibrary.java b/plugins/linux/src/java/net/java/games/input/JInputLibrary.java
index 57dbf07..5dbd217 100644
--- a/plugins/linux/src/java/net/java/games/input/JInputLibrary.java
+++ b/plugins/linux/src/java/net/java/games/input/JInputLibrary.java
@@ -12,7 +12,7 @@ public class JInputLibrary {
private static boolean shutdown = false;
private static Object shutdownThreadMonitor = new Object();
private static boolean cleanupDone = false;
- private static int rumbler;
+ private static int rumbler = -1;
private static float force;
public static boolean isSupported() {
@@ -102,6 +102,9 @@ public class JInputLibrary {
}
System.out.println("Environment cleanup");
for(int i=0;i<JInputLibrary.getNumberOfDevices();i++) {
+ if(JInputLibrary.getFFEnabled(i)) {
+ JInputLibrary.nativeRumble(i, 0f);
+ }
JInputLibrary.nativeCleanup(i);
}
}
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxDeviceRumbler.java b/plugins/linux/src/java/net/java/games/input/LinuxDeviceRumbler.java
index 4f28f1c..df8dd84 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxDeviceRumbler.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxDeviceRumbler.java
@@ -8,12 +8,6 @@ public class LinuxDeviceRumbler implements Rumbler {
public LinuxDeviceRumbler(int deviceID) {
this.deviceID = deviceID;
-
- Runtime.getRuntime().addShutdownHook(new Thread() {
- public void run() {
- cleanup();
- }
- });
}
public void rumble(float intensity) {
@@ -31,8 +25,4 @@ public class LinuxDeviceRumbler implements Rumbler {
return null;
}
- private void cleanup() {
- rumble(0f);
- }
-
}