1
0
Fork 0

Close settings files and save them correctly

mutilcraft-mt53
SmallJoker 2014-12-06 17:26:22 +01:00 committed by kwolekr
parent 4fcf9fb66a
commit d75f0b0360
1 changed files with 5 additions and 2 deletions

View File

@ -350,8 +350,11 @@ bool Settings::updateConfigFile(const char *filename)
std::ifstream is(filename);
std::ostringstream os(std::ios_base::binary);
if (!updateConfigObject(is, os, ""))
bool was_modified = updateConfigObject(is, os, "");
is.close();
if (!was_modified)
return true;
if (!fs::safeWriteToFile(filename, os.str())) {