mirror of https://github.com/ARMmbed/mbed-os.git
Call HAL free functions from C++ destructors
Add missing calls to HAL free to the following drivers - AnalogIn - QSPI - SerialBasepull/13318/head
parent
3a8989a247
commit
9e4be5e494
|
@ -151,7 +151,9 @@ public:
|
||||||
|
|
||||||
virtual ~AnalogIn()
|
virtual ~AnalogIn()
|
||||||
{
|
{
|
||||||
// Do nothing
|
lock();
|
||||||
|
analogin_free(&_adc);
|
||||||
|
unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -117,6 +117,9 @@ public:
|
||||||
|
|
||||||
virtual ~QSPI()
|
virtual ~QSPI()
|
||||||
{
|
{
|
||||||
|
lock();
|
||||||
|
qspi_free(&_qspi);
|
||||||
|
unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Configure the data transmission format
|
/** Configure the data transmission format
|
||||||
|
|
|
@ -287,6 +287,10 @@ SerialBase::~SerialBase()
|
||||||
for (int irq = 0; irq < IrqCnt; irq++) {
|
for (int irq = 0; irq < IrqCnt; irq++) {
|
||||||
attach(nullptr, (IrqType)irq);
|
attach(nullptr, (IrqType)irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_rx_enabled || _tx_enabled) {
|
||||||
|
serial_free(&_serial);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DEVICE_SERIAL_FC
|
#if DEVICE_SERIAL_FC
|
||||||
|
|
Loading…
Reference in New Issue