]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxConfig memory leak in wxFontMapper
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 Dec 2001 00:09:50 +0000 (00:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 7 Dec 2001 00:09:50 +0000 (00:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/fontmap.cpp

index ca2eaa905ce915d7b76f5f25bfe6a37251977832..54a7b71238755ce88981c96fc0c4245938c7a4e3 100644 (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,