Fix exception on shutdown

Improve error handling during shutdown
This commit is contained in:
Flamefire committed 2014-10-16 19:08:20 +02:00
1 parent 2371eb4344
commit b8bd9bf87b
4 files changed
+12 -6

No files matched your search

+9 -2
View File
@@ -279,8 +279,15 @@ namespace Vocaluxe
CRecord.Close();
CSound.Close();
CDraw.Close();
GC.Collect(); // Do a GC run here before we close logs to have finalizers run
CLog.CloseAll(); // Do this last, so we get all log entries!
}
catch (Exception e)
{
CLog.LogError("Error during shutdown!", false, false, e);
}
GC.Collect(); // Do a GC run here before we close logs to have finalizers run
try
{
CLog.Close(); // Do this last, so we get all log entries!
}
catch (Exception) {}
Environment.Exit(Environment.ExitCode);