From 9fe7a9ad57d92e6051326e5d107c9595faa917b7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Jul 2013 14:12:35 +0000 Subject: [PATCH 1/1] Make destructors of COM interface classes virtual. This is needed to at least silence g++ warnings but may actually even fix a real problem as these classes can be inherited from and are deleted via a pointer (to "this" itself, in Release() implementation). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/webview_ie.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/wx/msw/webview_ie.h b/include/wx/msw/webview_ie.h index e51ec3e03d..20a84fdf2e 100644 --- a/include/wx/msw/webview_ie.h +++ b/include/wx/msw/webview_ie.h @@ -221,7 +221,7 @@ protected: public: VirtualProtocol(wxSharedPtr handler); - ~VirtualProtocol() {} + virtual ~VirtualProtocol() {} //IUnknown DECLARE_IUNKNOWN_METHODS; @@ -256,7 +256,8 @@ class ClassFactory : public IClassFactory { public: ClassFactory(wxSharedPtr handler) : m_handler(handler) - { AddRef(); } + { AddRef(); } + virtual ~ClassFactory() {} wxString GetName() { return m_handler->GetName(); } @@ -286,7 +287,7 @@ class DocHostUIHandler : public wxIDocHostUIHandler { public: DocHostUIHandler(wxWebView* browser) { m_browser = browser; } - ~DocHostUIHandler() {}; + virtual ~DocHostUIHandler() {} virtual HRESULT wxSTDCALL ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, -- 2.45.2