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