diff options
author | endolf <[email protected]> | 2006-01-12 22:16:10 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2006-01-12 22:16:10 +0000 |
commit | 09bdd72a93f2a5498137d22540d035df87cff174 (patch) | |
tree | e6a223eaf343e0fd723a78be2688df16c3bf3112 /plugins/linux/src/native/jinput.cpp | |
parent | 133e7f43a01e4c2423e68a0f3f1e946818bb2bda (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/native/jinput.cpp')
-rw-r--r-- | plugins/linux/src/native/jinput.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/linux/src/native/jinput.cpp b/plugins/linux/src/native/jinput.cpp index c6294a7..40f0d29 100644 --- a/plugins/linux/src/native/jinput.cpp +++ b/plugins/linux/src/native/jinput.cpp @@ -335,7 +335,10 @@ JNIEXPORT jboolean JNICALL Java_net_java_games_input_JInputLibrary_getFFEnabled */ JNIEXPORT void JNICALL Java_net_java_games_input_JInputLibrary_nativeRumble (JNIEnv *, jclass, jint deviceID, jfloat force) { - jinputDeviceList[deviceID]->rumble(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; } } |