Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dereferencing polymorphic pointers #2

Open
ztnel opened this issue May 19, 2021 · 0 comments
Open

Dereferencing polymorphic pointers #2

ztnel opened this issue May 19, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ztnel
Copy link
Member

ztnel commented May 19, 2021

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

@ztnel ztnel added the bug Something isn't working label May 19, 2021
@ztnel ztnel self-assigned this May 19, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant