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
Class Bmi has virtual member functions, but no virtual destructor #11
Comments
This results in compiler warnings such as this:
|
@aufdenkampe Have you run into this issue in your work BMI-ing C++ models? Note that @PhilMiller provides a fix in #12. |
@mdpiper, I think merging PR #12 from @PhilMiller makes sense to me. Although our team still haven't gotten far enough along with our BMI C++ work to have encountered an issue with not having a virtual destructor method, from my work with embedded C++ (in https://github.com/EnviroDIY/ModularSensors), I know that adding an virtual destructor method to every class is important, to be able to clear an instantiated object from memory. The syntax that @PhilMiller suggested is exactly the way we implement destructors in our code. |
@aufdenkampe Thank you for your comment on this. I'll try to get things moving in the PR. |
Anything inheriting from the provided
Bmi
class and being referred to through that abstract base class will run afoul of an inability to properly destroy itself and its members.Cf https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-dtor
The text was updated successfully, but these errors were encountered: