Open
Description
Tone.cpp has a small memory leak. void Stop() set pointer pin to nullptr and clears the pointer before the destructor is called, which later attempts to delete pin. Since the pointer was already set to nullptr, the dynamically allocated mbed::DigitalOut instance is never deleted, leading to a memory leak every time a new Tone object is created.
Fixed by removing pin=0 and letting the destructor delete pin.
Metadata
Metadata
Assignees
Labels
No labels