Skip to content

OLEDDisplay.h should have a virtual destructor #143

@TD-er

Description

@TD-er

To allow for more dynamic usage of the library and allow to switch between types, one would create a pointer to the base class (OLEDDisplay) and create a new instance of the object (e.g. SSD1306Wire).
When the object is deleted, only the base class will be deleted unless the destructor is declared virtual.

So a quick fix would be to add the following line to OLEDDisplay.h:
virtual ~OLEDDisplay() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions