Use accessor function for theConfig

This commit is contained in:
Vinnie Falco
2013-07-24 07:28:11 -07:00
parent c27294e0f0
commit 788817e55c
30 changed files with 257 additions and 263 deletions

View File

@@ -18,7 +18,11 @@
// VFALCO TODO Convert this to a SharedSingleton to prevent exit leaks
//
Config theConfig;
Config& getConfig ()
{
static Config config;
return config;
}
Config::Config ()
: m_rpcPort (5001)
@@ -315,13 +319,13 @@ void Config::load ()
//
// VFALCO BEGIN CLEAN
//
theConfig.nodeDatabase = parseKeyValueSection (
getConfig ().nodeDatabase = parseKeyValueSection (
secConfig, ConfigSection::nodeDatabase ());
theConfig.ephemeralNodeDatabase = parseKeyValueSection (
getConfig ().ephemeralNodeDatabase = parseKeyValueSection (
secConfig, ConfigSection::tempNodeDatabase ());
theConfig.importNodeDatabase = parseKeyValueSection (
getConfig ().importNodeDatabase = parseKeyValueSection (
secConfig, ConfigSection::importNodeDatabase ());
//
// VFALCO END CLEAN