From f807d527b07f57c5eb4999acb573ddf1f4377014 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 16 Sep 2017 23:20:42 +0200 Subject: [PATCH] #143 Use virtual destructor on base class To make sure derived objects are completely destructed when calling destructor on base class. --- OLEDDisplay.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OLEDDisplay.h b/OLEDDisplay.h index 81537a2..6286b96 100644 --- a/OLEDDisplay.h +++ b/OLEDDisplay.h @@ -110,6 +110,8 @@ enum OLEDDISPLAY_TEXT_ALIGNMENT { class OLEDDisplay : public Print { public: + virtual ~OLEDDisplay() {} + // Initialize the display bool init(); @@ -150,7 +152,7 @@ class OLEDDisplay : public Print { // Draw a lin vertically void drawVerticalLine(int16_t x, int16_t y, int16_t length); - // Draws a rounded progress bar with the outer dimensions given by width and height. Progress is + // Draws a rounded progress bar with the outer dimensions given by width and height. Progress is // a unsigned byte value between 0 and 100 void drawProgressBar(uint16_t x, uint16_t y, uint16_t width, uint16_t height, uint8_t progress);