mirror of https://github.com/ArduPilot/ardupilot
AP_InertialSensor: ensure that accel calibration object isn't allocated more than once
This commit is contained in:
parent
57d2594bd7
commit
f6a41a8936
|
@ -1241,9 +1241,14 @@ bool AP_InertialSensor::is_still()
|
|||
// called during the startup of accel cal
|
||||
void AP_InertialSensor::acal_init()
|
||||
{
|
||||
_acal = new AP_AccelCal;
|
||||
if (_acal == NULL) {
|
||||
_acal = new AP_AccelCal;
|
||||
}
|
||||
if (_accel_calibrator == NULL) {
|
||||
_accel_calibrator = new AccelCalibrator[INS_MAX_INSTANCES];
|
||||
}
|
||||
|
||||
_acal->register_client(this);
|
||||
_accel_calibrator = new AccelCalibrator[INS_MAX_INSTANCES];
|
||||
}
|
||||
|
||||
// update accel calibrator
|
||||
|
|
Loading…
Reference in New Issue