TempFileManager throws less exceptions

This commit is contained in:
zeromus 2015-11-17 17:41:01 -06:00
parent 5086ea62c2
commit 4b46bc60bb
1 changed files with 13 additions and 10 deletions

View File

@ -47,6 +47,8 @@ namespace BizHawk.Common
{
var di = new DirectoryInfo(Path.GetTempPath());
for (; ; )
{
if (!System.Diagnostics.Debugger.IsAttached) //exceptions due to can't-delete are annoying. see this for another approach: http://www.codeproject.com/Articles/14402/Testing-File-Access-Rights-in-NET
{
var fis = di.GetFiles("bizdelete-*");
foreach (var fi in fis)
@ -62,6 +64,7 @@ namespace BizHawk.Common
//try not to do more than one thing per frame
System.Threading.Thread.Sleep(100);
}
}
//try not to slam the filesystem too hard, we dont want this to cause any hiccups
System.Threading.Thread.Sleep(5000);