diff --git a/Library/ConfigParser.cpp b/Library/ConfigParser.cpp index 9ff7e7da..ab0c4bac 100644 --- a/Library/ConfigParser.cpp +++ b/Library/ConfigParser.cpp @@ -136,6 +136,19 @@ const std::wstring& CConfigParser::ReadString(LPCTSTR section, LPCTSTR key, LPCT { static std::wstring result; + if (section == NULL) + { + section = L""; + } + if (key == NULL) + { + key = L""; + } + if (defValue == NULL) + { + defValue = L""; + } + result = GetValue(section, key, defValue); if (result == defValue) { diff --git a/Library/MeasureRegistry.cpp b/Library/MeasureRegistry.cpp index 3c5d6035..536a118d 100644 --- a/Library/MeasureRegistry.cpp +++ b/Library/MeasureRegistry.cpp @@ -154,6 +154,7 @@ void CMeasureRegistry::ReadConfig(CConfigParser& parser, const WCHAR* section) } // Try to open the key + if(m_RegKey) RegCloseKey(m_RegKey); RegOpenKeyEx(m_HKey, m_RegKeyName.c_str(), 0, KEY_READ, &m_RegKey); } diff --git a/Library/MeterString.cpp b/Library/MeterString.cpp index 6b9aa36b..fdec10d3 100644 --- a/Library/MeterString.cpp +++ b/Library/MeterString.cpp @@ -106,6 +106,7 @@ void CMeterString::Initialize() { CMeter::Initialize(); + if(m_FontFamily) delete m_FontFamily; m_FontFamily = new FontFamily(m_FontFace.c_str()); Status status = m_FontFamily->GetLastStatus(); if(Ok != status) @@ -140,10 +141,12 @@ void CMeterString::Initialize() if (m_FontFamily) { + if(m_Font) delete m_Font; m_Font = new Gdiplus::Font(m_FontFamily, size, style); } else { + if(m_Font) delete m_Font; m_Font = new Gdiplus::Font(FontFamily::GenericSansSerif(), size, style); }