Don't destroy wxFont from its GetFaceName() in wxMSW.

wxFont::GetFaceName() could destroy the HFONT used by the font accidentally,
avoid it by not invalidating the font when caching its face name.

Closes #16273.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76595 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-05-22 14:35:49 +00:00
parent 2b223cdaa9
commit d96fd33985

View File

@ -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<wxFontRefData *>(this)->SetFaceName(facename);
// Don't call this->SetFaceName(), because it deletes the HFONT.
const_cast<wxNativeFontInfo &>(m_nativeFontInfo).SetFaceName(facename);
}
}