Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Make WiFiManagerParameter destructor virtual #1692

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rguca
Copy link

@rguca rguca commented Dec 28, 2023

If a instance of WiFiManagerParameter is created by new and deleted by delete, a compiler warning is issued.

src/settings/SettingsController.cpp:78:67: warning: deleting object of polymorphic class type 'WiFiManagerParameter' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
   78 |   for (WiFiManagerParameter* p : this->wifi_settings->parameters) delete p;

The destructor should be virtual, because the class can be extended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant