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

Provider derived class destruction uses static binding instead of dynamic binding #13

Open
yblake opened this issue Oct 21, 2022 · 1 comment

Comments

@yblake
Copy link

yblake commented Oct 21, 2022

VS 2022 complains with warning C5205 because Provider abstract class defines a non virtual destructor, which may lead to undefined behaviour as objects destruction in ndfrmwrk.cpp use static binding instead of dynamic binding.

Suggested correction :

  • To ensure all destructors are called, nedd to change ~Provider(void); to virtual ~Provider(void); in ndprov.h
  • Should also comment (or delete) ~NdV1Provider(); and ~NdProvider(); definitions, since these derived constructors are not implemented.
  • Finally, suppress AdditionalOptions /Wv:18 added by PR ADD AdditionalOptions Wv:18
@yblake
Copy link
Author

yblake commented Oct 23, 2022

Same potential memory leak in test abstract classes, that may be improperly destroyed. In ndtestutil.h, change destructors from ~NdTestBase(); to virtual ~NdTestBase(); , and ~NdTestServerBase(); to virtual ~NdTestServerBase();.

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

No branches or pull requests

1 participant