AP_InertialSensor: fixed freeing of fifo buffer

This commit is contained in:
Andrew Tridgell 2016-11-24 10:03:44 +11:00
parent 6f28c61c8d
commit f3a778f980
2 changed files with 4 additions and 1 deletions

View File

@ -262,7 +262,7 @@ AP_InertialSensor_MPU6000::AP_InertialSensor_MPU6000(AP_InertialSensor &imu,
AP_InertialSensor_MPU6000::~AP_InertialSensor_MPU6000()
{
if (_fifo_buffer != nullptr) {
delete[] _fifo_buffer;
hal.util->dma_free(_fifo_buffer, MPU_FIFO_BUFFER_LEN * MPU_SAMPLE_SIZE);
}
delete _auxiliary_bus;
}

View File

@ -220,6 +220,9 @@ AP_InertialSensor_MPU9250::AP_InertialSensor_MPU9250(AP_InertialSensor &imu,
AP_InertialSensor_MPU9250::~AP_InertialSensor_MPU9250()
{
if (_fifo_buffer != nullptr) {
hal.util->dma_free(_fifo_buffer, MPU_FIFO_BUFFER_LEN * MPU_SAMPLE_SIZE);
}
delete _auxiliary_bus;
}