From 09bdd72a93f2a5498137d22540d035df87cff174 Mon Sep 17 00:00:00 2001 From: endolf Date: Thu, 12 Jan 2006 22:16:10 +0000 Subject: 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 --- plugins/linux/src/java/net/java/games/input/JInputLibrary.java | 5 ++++- .../src/java/net/java/games/input/LinuxDeviceRumbler.java | 10 ---------- plugins/linux/src/native/jinput.cpp | 8 ++++++-- 3 files changed, 10 insertions(+), 13 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;irumble(force); + if(jinputDeviceList[deviceID]!=0) { + LOG_TRACE("Setting rumble on device %d to %d\n", deviceID, force); + jinputDeviceList[deviceID]->rumble(force); + } } /* @@ -346,8 +349,9 @@ JNIEXPORT void JNICALL Java_net_java_games_input_JInputLibrary_nativeRumble JNIEXPORT void JNICALL Java_net_java_games_input_JInputLibrary_nativeCleanup (JNIEnv *, jclass, jint deviceID) { if(jinputDeviceList[deviceID]!=0) { + LOG_TRACE("Cleaning up device %d\n", deviceID); jinputDeviceList[deviceID]->cleanup(); - free(jinputDeviceList); + free(jinputDeviceList[deviceID]); jinputDeviceList[deviceID]=0; } } -- cgit v1.2.3