Skip to content

Commit

Permalink
Added missing virtual destructors
Browse files Browse the repository at this point in the history
  • Loading branch information
andreagilardoni committed Nov 21, 2023
1 parent fc9a636 commit 9f42b34
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/Print.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Print
void setWriteError(int err = 1) { write_error = err; }
public:
Print() : write_error(0) {}
virtual ~Print() {}


int getWriteError() { return write_error; }
void clearWriteError() { setWriteError(0); }
Expand Down
1 change: 1 addition & 0 deletions api/Printable.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class Print;
class Printable
{
public:
virtual ~Printable() {}
virtual size_t printTo(Print& p) const = 0;
};

Expand Down
2 changes: 1 addition & 1 deletion api/String.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class String
explicit String(unsigned long, unsigned char base=10);
explicit String(float, unsigned char decimalPlaces=2);
explicit String(double, unsigned char decimalPlaces=2);
~String(void);
virtual ~String(void);

// memory management
// return true on success, false on failure (in which case, the string
Expand Down

0 comments on commit 9f42b34

Please sign in to comment.