Added NULL checks for the CConfigParser::ReadString()'s parameters (http://code.google.com/p/rainmeter/issues/detail?id=105).

The font and registry handle are now free'ed properly if Initialize() is called multiple times.
This commit is contained in:
Kimmo Pekkola
2009-09-02 17:04:47 +00:00
parent 81f674117d
commit 9fcd6896de
3 changed files with 17 additions and 0 deletions

View File

@ -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)
{