savestate backup had delete (it's asynchronous) vs move race condition

This commit is contained in:
zeromus 2016-02-21 22:01:24 -06:00
parent 252dbe62ce
commit 10b8a54e6c
1 changed files with 5 additions and 0 deletions

View File

@ -3804,6 +3804,11 @@ namespace BizHawk.Client.EmuHawk
backupFile.Delete();
}
//deletes are asynchronous, need to wait for it to be gone
//TODO - make a common utility method to replace a backup including this whole process
while (backupFile.Exists)
Thread.Sleep(10);
File.Move(path, backup);
}