17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

fix(editor): release the scenario file after load, undo a failed save

This commit is contained in:
2026-10-02 22:54:19 +02:00
parent 3199f3796e
commit a612b0c96c
3 changed files with 32 additions and 2 deletions

View File

@@ -418,6 +418,7 @@ bool save(std::string const &File, include_info const &Info, std::string &Error)
if (error)
{
Error = "can't replace file \"" + File + "\": " + error.message();
std::filesystem::remove(filepath + ".tmp", error);
return false;
}
return true;