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:
Sarah Tappon
2015-05-06 22:59:21 -07:00
parent c28954844f
commit 1a266c24bf

View File

@ -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) {};