mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 02:32:36 +01:00
Savestates: Fixup file write
This commit is contained in:
parent
0fcb0b7d8e
commit
91a54c11eb
@ -2479,10 +2479,13 @@ bool fs::pending_file::commit(bool overwrite)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
// Disable auto-delete
|
||||
FILE_DISPOSITION_INFO disp;
|
||||
disp.DeleteFileW = false;
|
||||
SetFileInformationByHandle(file.get_handle(), FileDispositionInfo, &disp, sizeof(disp));
|
||||
if (file)
|
||||
{
|
||||
// Disable auto-delete
|
||||
FILE_DISPOSITION_INFO disp;
|
||||
disp.DeleteFileW = false;
|
||||
ensure(SetFileInformationByHandle(file.get_handle(), FileDispositionInfo, &disp, sizeof(disp)));
|
||||
}
|
||||
#endif
|
||||
|
||||
file.close();
|
||||
|
@ -3345,13 +3345,13 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
|
||||
|
||||
set_progress_message("Commiting File");
|
||||
|
||||
fs::file to_close_file;
|
||||
{
|
||||
auto& ar = *to_ar->load();
|
||||
auto reset = init_mtx->reset();
|
||||
to_close_file = std::move(file.file);
|
||||
ar = {};
|
||||
ar.set_reading_state(); // Guard against using it
|
||||
reset.set_init();
|
||||
}
|
||||
to_close_file.close();
|
||||
|
||||
if (!file.commit() || !fs::get_stat(path, file_stat))
|
||||
{
|
||||
|
@ -740,7 +740,7 @@ void gui_application::InitializeCallbacks()
|
||||
verbose_message = "\n" + *str_ptr;
|
||||
}
|
||||
|
||||
bytes_written = std::max<usz>(ar_ptr->get_size(), old_written);
|
||||
bytes_written = ar_ptr->is_writing() ? std::max<usz>(ar_ptr->get_size(), old_written) : old_written;
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user