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

@ -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);
}