From 1a266c24bf33ff7188d549268d8c5fd055194792 Mon Sep 17 00:00:00 2001 From: Sarah Tappon Date: Wed, 6 May 2015 22:59:21 -0700 Subject: [PATCH] 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 --- Adafruit_Sensor.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Adafruit_Sensor.h b/Adafruit_Sensor.h index beb51c8..4e10868 100644 --- a/Adafruit_Sensor.h +++ b/Adafruit_Sensor.h @@ -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) {};