]> git.mxchange.org Git - flightgear.git/commitdiff
Joystick fixes from Tony.
authorcurt <curt>
Wed, 20 Sep 2000 20:35:49 +0000 (20:35 +0000)
committercurt <curt>
Wed, 20 Sep 2000 20:35:49 +0000 (20:35 +0000)
src/Joystick/joystick.cxx

index 18a2d16b7733448dbc14d90677f84b9d330765e9..8fa31a44da28cbe9d380d195bb71388e4e8f6414 100644 (file)
@@ -453,10 +453,11 @@ int
 fgJoystickRead()
 {
     int buttons;
+    float *axis_values = new float[MAX_AXES];
 
     for (int i = 0; i < MAX_JOYSTICKS; i++) {
        jsJoystick * js = joysticks[i].js;
-       float *axis_values = new float[joysticks[i].naxes];
+       // float *axis_values = new float[joysticks[i].naxes];
        if (js->notWorking()) {
            continue;
        }
@@ -555,14 +556,12 @@ fgJoystickRead()
                FG_LOG(FG_INPUT, FG_ALERT, "Failed to set value for "
                       << jsNames[i] << ' ' << buttonNames[j]);
        }
-
-       // -dw- cleanup 
-       delete axis_values;
-
     }
 
+    // -dw- cleanup 
+    delete axis_values;
+
     return true;
 }
 
 // end of joystick.cxx
-