delete works for nullptr, no need to set a member in the destructor
This commit is contained in:
parent
1c1c73ee85
commit
3561fd9ff6
|
|
@ -75,12 +75,7 @@ Adafruit_SPIDevice::Adafruit_SPIDevice(int8_t cspin, int8_t sckpin,
|
||||||
/*!
|
/*!
|
||||||
* @brief Release memory allocated in constructors
|
* @brief Release memory allocated in constructors
|
||||||
*/
|
*/
|
||||||
Adafruit_SPIDevice::~Adafruit_SPIDevice() {
|
Adafruit_SPIDevice::~Adafruit_SPIDevice() { delete _spiSetting; }
|
||||||
if (_spiSetting) {
|
|
||||||
delete _spiSetting;
|
|
||||||
_spiSetting = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Initializes SPI bus and sets CS pin high
|
* @brief Initializes SPI bus and sets CS pin high
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue