TempFileManager throws less exceptions
This commit is contained in:
parent
5086ea62c2
commit
4b46bc60bb
|
@ -48,19 +48,22 @@ namespace BizHawk.Common
|
||||||
var di = new DirectoryInfo(Path.GetTempPath());
|
var di = new DirectoryInfo(Path.GetTempPath());
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
var fis = di.GetFiles("bizdelete-*");
|
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
|
||||||
foreach (var fi in fis)
|
|
||||||
{
|
{
|
||||||
try
|
var fis = di.GetFiles("bizdelete-*");
|
||||||
|
foreach (var fi in fis)
|
||||||
{
|
{
|
||||||
fi.Delete();
|
try
|
||||||
}
|
{
|
||||||
catch
|
fi.Delete();
|
||||||
{
|
}
|
||||||
}
|
catch
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
//try not to do more than one thing per frame
|
//try not to do more than one thing per frame
|
||||||
System.Threading.Thread.Sleep(100);
|
System.Threading.Thread.Sleep(100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//try not to slam the filesystem too hard, we dont want this to cause any hiccups
|
//try not to slam the filesystem too hard, we dont want this to cause any hiccups
|
||||||
|
|
Loading…
Reference in New Issue