Skip to content

fix: non-virtual-dtor warning#1500

Closed
qwertycxz wants to merge 1 commit intomicrosoft:masterfrom
qwertycxz:patch-1
Closed

fix: non-virtual-dtor warning#1500
qwertycxz wants to merge 1 commit intomicrosoft:masterfrom
qwertycxz:patch-1

Conversation

@qwertycxz
Copy link

This virtual destructor will resolve the warning of option -Wnon-virtual-dtor in MinGW.

Fixes: #1499

This virtual destructor will resolve the warning of option `-Wnon-virtual-dtor` in MinGW.
@sylveon
Copy link
Contributor

sylveon commented Aug 5, 2025

You are not meant to delete classes which derive from IUnknown. They automatically delete themselves once the ref count reaches 0. Adding the virtual destructor changes the offset of every function in interfaces that derive from IUnknown, breaking the COM ABI.

The correct resolution here is to suppress the warning, not declare the virtual dtor.

@qwertycxz qwertycxz closed this Aug 5, 2025
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.

Bug: -Wnon-virtual-dtor warn

2 participants