Commit f7413b8a authored by louiz’'s avatar louiz’

Clearer way to do init conf

parent d0cbc25f
......@@ -6,16 +6,14 @@ bool Config::read_conf(const std::string& filename)
{
if (instance == 0)
{
instance = new Config();
std::ifstream file;
file.open(filename.data());
if (!file.is_open())
{
std::cerr << "Error: cannot open config file " << filename << std::endl;
delete instance;
instance = 0;
return false;
}
instance = new Config();
instance->filename = filename;
std::string line;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment