AP_InertialSensor: MPU6000: fix leaking samples

This commit is contained in:
Lucas De Marchi 2015-08-04 01:24:27 -03:00 committed by Andrew Tridgell
parent f18dd17377
commit d9a4d3e777
2 changed files with 2 additions and 1 deletions

View File

@ -397,6 +397,7 @@ AP_InertialSensor_MPU6000::AP_InertialSensor_MPU6000(AP_InertialSensor &imu, AP_
AP_InertialSensor_MPU6000::~AP_InertialSensor_MPU6000() AP_InertialSensor_MPU6000::~AP_InertialSensor_MPU6000()
{ {
delete _bus; delete _bus;
delete _samples;
} }
/* Detect the sensor on SPI bus. It must have a corresponding device on /* Detect the sensor on SPI bus. It must have a corresponding device on

View File

@ -111,7 +111,7 @@ private:
#endif #endif
volatile uint16_t _sum_count; volatile uint16_t _sum_count;
bool _fifo_mode; bool _fifo_mode;
uint8_t *_samples; uint8_t *_samples = nullptr;
}; };
class AP_MPU6000_BusDriver_SPI : public AP_MPU6000_BusDriver class AP_MPU6000_BusDriver_SPI : public AP_MPU6000_BusDriver