From 10b8a54e6c3a926f094f8f0f28a316bcfdb9976e Mon Sep 17 00:00:00 2001 From: zeromus Date: Sun, 21 Feb 2016 22:01:24 -0600 Subject: [PATCH] savestate backup had delete (it's asynchronous) vs move race condition --- BizHawk.Client.EmuHawk/MainForm.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BizHawk.Client.EmuHawk/MainForm.cs b/BizHawk.Client.EmuHawk/MainForm.cs index 822bc34c6c..1d1fd69989 100644 --- a/BizHawk.Client.EmuHawk/MainForm.cs +++ b/BizHawk.Client.EmuHawk/MainForm.cs @@ -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); }