-
-
Notifications
You must be signed in to change notification settings - Fork 134
Open
Labels
Description
Description
Missing virtual destructor - memory leak and UB
Environment
First found on R4, but it is general
Current behavior
Warning while compiling sketch, possible UB.
packages/arduino/hardware/renesas_uno/1.5.0/libraries/WiFiS3/src/Modem.cpp: In destructor 'ModemClass::~ModemClass()':
packages/arduino/hardware/renesas_uno/1.5.0/libraries/WiFiS3/src/Modem.cpp:27:14: warning: deleting object of polymorphic
class type 'UART' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete _serial;
ModemClass extends Serial which extends Print.
Expected behavior
no warnings
Additional information
This class is very base class of all streams and other i/o components.
Line 35 in 4a02bfc
class Print |