diff --git a/docs/changes.txt b/docs/changes.txt index 34683325ad..f20c778039 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -661,6 +661,7 @@ wxMSW: - Don't fail when using large paper sizes in print preview. - Fix wxRichMessageDialog return value for dialog with only "OK" button. - Fix precision loss in wxGraphicsContext::{Draw,Stroke}Lines() (tibo_). +- Fix destroying the font from wxFont::GetFaceName() in some cases (aebailey82). wxOSX: diff --git a/src/msw/font.cpp b/src/msw/font.cpp index bbf7d849a6..6c747e821e 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -149,7 +149,8 @@ public: { // cache the face name, it shouldn't change unless the family // does and wxNativeFontInfo::SetFamily() resets the face name - const_cast(this)->SetFaceName(facename); + // Don't call this->SetFaceName(), because it deletes the HFONT. + const_cast(m_nativeFontInfo).SetFaceName(facename); } }