Skip to content

Dereferencing polymorphic pointers #2

@ztnel

Description

@ztnel

Compile warning on Adafruit_SSD1306 lib implementation

/home/ubuntu/telemeter/include/Oled/Oled.cpp:34:12: warning: deleting object of polymorphic class type 'Adafruit_SSD1306' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
     delete display;
            ^~~~~~~

See here: https://wiki.sei.cmu.edu/confluence/display/cplusplus/OOP52-CPP.+Do+not+delete+a+polymorphic+object+without+a+virtual+destructor

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions