arduino-libraries / Ethernet

Ethernet Library for Arduino
http://arduino.cc/
259 stars 264 forks source link

Missing virtual destructor results in compiler warning #153

Closed fredlcore closed 2 years ago

fredlcore commented 3 years ago

When deleteing an EthernetClient object, the compiler throws the following warning: warning: deleting object of polymorphic class type 'EthernetClient' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor] Adding a virtual destructor solves this problem, see also here: https://stackoverflow.com/questions/43282826/suppress-delete-non-virtual-dtor-warning-when-using-a-protected-non-virtual-dest