mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-14 02:38:37 +12:00
Savestates: Fix rare race
This commit is contained in:
parent
6b906b9a9c
commit
51e1598e42
2 changed files with 28 additions and 6 deletions
|
@ -3318,6 +3318,14 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
|
|||
|
||||
set_progress_message("Commiting File");
|
||||
|
||||
fs::file to_close_file;
|
||||
{
|
||||
auto reset = init_mtx->reset();
|
||||
to_close_file = std::move(file.file);
|
||||
reset.set_init();
|
||||
}
|
||||
to_close_file.close();
|
||||
|
||||
if (!file.commit() || !fs::get_stat(path, file_stat))
|
||||
{
|
||||
sys_log.error("Failed to write savestate to file! (path='%s', %s)", path, fs::g_tls_error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue