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

fix: Add a virtual destructor to DependencyProvider #50

Merged

Conversation

jjerphan
Copy link
Member

@jjerphan jjerphan commented Jun 24, 2024

When subclassing DependencyProvider, I currently get this warning:

warning: base class 'struct resolvo::DependencyProvider' has accessible non-virtual destructor [-Wnon-virtual-dtor]
   53 | struct PackageDatabase : public DependencyProvider {
      |        ^~~~~~~~~~~~~~~

I think any base class which has at least one virtual function, must have virtual destructor to respect class polymorphism.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@jjerphan jjerphan changed the title fix: Add a virtual destructor for DependencyProvider fix: Add a virtual destructor to DependencyProvider Jun 24, 2024
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
@baszalmstra
Copy link
Contributor

Can you explain why that is needed? The code that interfaces with the provider doesnt destruct it, does it?

@jjerphan jjerphan marked this pull request as ready for review June 24, 2024 08:33
@baszalmstra
Copy link
Contributor

Nvm, did my research! 🧐 LGTM!

@baszalmstra baszalmstra merged commit 0a0ea92 into mamba-org:main Jun 24, 2024
13 checks passed
@jjerphan jjerphan deleted the fix/DependencyProvider-virtual-destructor branch June 24, 2024 08:34
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.

2 participants