Browse Source

Fix an unbounded loop in the joystick code

This fixes a bug introduced in b62a533 which, when a joystick was disabled
and uncalibrated, caused unbounded recursive calls to Joystick::startPolling.
QGC4.4
James Mare 2 years ago committed by Patrick José Pereira
parent
commit
0c428b5cfc
  1. 4
      src/Vehicle/Vehicle.cc

4
src/Vehicle/Vehicle.cc

@ -2142,9 +2142,7 @@ void Vehicle::setJoystickEnabled(bool enabled) @@ -2142,9 +2142,7 @@ void Vehicle::setJoystickEnabled(bool enabled)
// if we are the active vehicle, call start polling on the active joystick
// This routes the joystick signals to this vehicle
// We do this even if we are disabling the joystick
// because it will trigger disconnection of the signals
if (_toolbox->multiVehicleManager()->activeVehicle() == this){
if (enabled && _toolbox->multiVehicleManager()->activeVehicle() == this){
_captureJoystick();
}

Loading…
Cancel
Save