mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
Don't overwrite config if the new one was not successfully written (#10284)
* Don't overwrite config if the new one was not successfully written The errors weren't being checked, now they are. Fixes #10283
This commit is contained in:
@@ -837,6 +837,10 @@ void AppConfig::save()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
c.close();
|
c.close();
|
||||||
|
if (c.fail()) {
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "Failed to write new configuration to " << path_pid << "; aborting attempt to overwrite original configuration";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Make a backup of the configuration file before copying it to the final destination.
|
// Make a backup of the configuration file before copying it to the final destination.
|
||||||
@@ -1042,6 +1046,10 @@ void AppConfig::save()
|
|||||||
c << appconfig_md5_hash_line(config_str);
|
c << appconfig_md5_hash_line(config_str);
|
||||||
#endif
|
#endif
|
||||||
c.close();
|
c.close();
|
||||||
|
if (c.fail()) {
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "Failed to write new configuration to " << path_pid << "; aborting attempt to overwrite original configuration";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// Make a backup of the configuration file before copying it to the final destination.
|
// Make a backup of the configuration file before copying it to the final destination.
|
||||||
|
|||||||
Reference in New Issue
Block a user