diff --git a/include/wx/msw/hyperlink.h b/include/wx/msw/hyperlink.h index e33d891e12..8ffd59e374 100644 --- a/include/wx/msw/hyperlink.h +++ b/include/wx/msw/hyperlink.h @@ -43,6 +43,7 @@ public: long style = wxHL_DEFAULT_STYLE, const wxString& name = wxASCII_STR(wxHyperlinkCtrlNameStr)); + virtual ~wxHyperlinkCtrl(); // overridden base class methods // ----------------------------- diff --git a/src/msw/hyperlink.cpp b/src/msw/hyperlink.cpp index 625c830c62..3351c4bf70 100644 --- a/src/msw/hyperlink.cpp +++ b/src/msw/hyperlink.cpp @@ -112,6 +112,17 @@ bool wxHyperlinkCtrl::Create(wxWindow *parent, return true; } +wxHyperlinkCtrl::~wxHyperlinkCtrl() +{ + if ( m_hWnd ) + { + // Due to https://bugs.winehq.org/show_bug.cgi?id=54066 we have to + // reset the font before the native control destroys it. + if ( wxIsRunningUnderWine() ) + ::SendMessage(m_hWnd, WM_SETFONT, 0, FALSE); + } +} + WXDWORD wxHyperlinkCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const { WXDWORD msStyle = wxControl::MSWGetStyle( style, exstyle );