Arm Mbed and Pelion Device Management support forum

Destructors of many mbed classes (GPIO) doesn't free up the pin

Why mbed-os dosen’t implement the destructor of the most used important clases?
Look at here :

 operator float()
{
    // Underlying call is thread safe
    return read();
}

virtual ~AnalogIn()
{
    **// Do nothing**
}


virtual ~AnalogOut()
{
    // Do nothing
}

DigitalInOut : There is no destructor defined at all

That is why when you dynamically create a GPIO port, you cannot free it when you delete the created port.
Any one can tell us why there are no destructores ?

I made a patch for some times ago by myself which was included but I cannot find the code in the latest mbed-os … Look at this page