forked from adafruit/Adafruit_Sensor
add virtual destructor
base classes without virtual destructors risk undefined behavior if their children are deleted through a pointer to base. see https://isocpp.org/wiki/faq/virtual-functions#virtual-dtors
This commit is contained in:
@ -140,6 +140,7 @@ class Adafruit_Sensor {
|
||||
public:
|
||||
// Constructor(s)
|
||||
void constructor();
|
||||
virtual ~Adafruit_Sensor() {}
|
||||
|
||||
// These must be defined by the subclass
|
||||
virtual void enableAutoRange(bool enabled) {};
|
||||
|
Reference in New Issue
Block a user