Skip to content
Snippets Groups Projects
Commit 3a1c22d2 authored by René Fritze's avatar René Fritze
Browse files

[config] avoid race in calling get in dtor

parent d99f4027
No related branches found
No related tags found
No related merge requests found
......@@ -132,20 +132,20 @@ public:
: warning_output_(false)
, tree_(tree)
, record_defaults_(false)
, logdir_(boost::filesystem::path(get("global.datadir", "data", false)) / get("logging.dir", "log", false))
{
}
ConfigContainer()
: warning_output_(true)
, record_defaults_(false)
, logdir_(boost::filesystem::path(get("global.datadir", "data", false)) / get("logging.dir", "log", false))
{
}
~ConfigContainer()
{
boost::filesystem::path logdir(get("global.datadir", "data", false));
logdir /= get("logging.dir", "log", false);
boost::filesystem::ofstream out(logdir / "paramter.log");
boost::filesystem::ofstream out(logdir_ / "paramter.log");
tree_.report(out);
}
......@@ -271,6 +271,7 @@ private:
//! config key -> requests map
RequestMapType requests_map_;
bool record_defaults_;
const boost::filesystem::path logdir_;
};
//! global ConfigContainer instance
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment