fixed wxConfig memory leak in wxFontMapper

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2001-12-07 00:09:50 +00:00
parent 5acc0d5f32
commit 4d416b5f21

View File

@ -237,6 +237,10 @@ wxFontMapper::wxFontMapper()
wxFontMapper::~wxFontMapper()
{
#if wxUSE_CONFIG
if ( m_configIsDummy )
delete m_config;
#endif // wxUSE_CONFIG
}
// ----------------------------------------------------------------------------
@ -289,6 +293,7 @@ wxConfigBase *wxFontMapper::GetConfig()
{
// VS: in case we created dummy m_config (see above), we want to switch back
// to the real one as soon as one becomes available.
delete m_config;
m_config = wxConfig::Get(FALSE);
m_configIsDummy = FALSE;
// FIXME: ideally, we should add keys from dummy config to the real one now,