From af3a5c8cb42a875272f89f04011a18ee50844164 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 31 May 2015 23:24:40 +0200 Subject: [PATCH] Avoid harmless warnings about non-virtual wxMSWOwnerDrawnButtonBase dtor. Make the dtor protected to ensure that it's impossible to delete objects via it as this is not supposed to be ever done anyhow. Closes #17005. --- include/wx/msw/ownerdrawnbutton.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/wx/msw/ownerdrawnbutton.h b/include/wx/msw/ownerdrawnbutton.h index 4888d59677..054076e675 100644 --- a/include/wx/msw/ownerdrawnbutton.h +++ b/include/wx/msw/ownerdrawnbutton.h @@ -32,6 +32,13 @@ protected: m_isHot = false; } + // Explicitly define the destructor even if it's trivial to make it + // protected. This avoids compiler warnings about the fact that this class + // has virtual functions, but no virtual destructor without making the dtor + // virtual which is not needed here as objects are never deleted via + // pointers to this class (and protected dtor enforces this). + ~wxMSWOwnerDrawnButtonBase() { } + // Make the control owner drawn if necessary to implement support for the // given foreground colour. void MSWMakeOwnerDrawnIfNecessary(const wxColour& colFg);