FileRegistry: fix problem with conf file not created.

https://github.com/audetto/AppleWin/issues/30

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2021-05-23 20:04:59 +01:00
parent 535ceaadc6
commit 09da101cbb

View file

@ -60,7 +60,6 @@ namespace
} }
else else
{ {
mySaveOnExit = false;
LogFileOutput("Registry: configuration file '%s' not found\n", filename.c_str()); LogFileOutput("Registry: configuration file '%s' not found\n", filename.c_str());
} }
} }
@ -69,7 +68,14 @@ namespace
{ {
if (mySaveOnExit) if (mySaveOnExit)
{ {
boost::property_tree::ini_parser::write_ini(myFilename, myINI); try
{
boost::property_tree::ini_parser::write_ini(myFilename, myINI);
}
catch(const std::exception& e)
{
LogFileOutput("Registry: cannot save settings to '%s': %s\n", myFilename.c_str(), e.what());
}
} }
} }