From b51fedd6c994ce00b946cb58d3b31906ad7f50de Mon Sep 17 00:00:00 2001 From: lukeIam <2lukeiam@gmail.com> Date: Mon, 26 Feb 2018 20:27:15 +0100 Subject: [PATCH] Fix: Fatal error are shown twice (on occurrence and on the next start) --- VocaluxeLib/Log/CLog.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/VocaluxeLib/Log/CLog.cs b/VocaluxeLib/Log/CLog.cs index 92b9328c..4c9cb746 100644 --- a/VocaluxeLib/Log/CLog.cs +++ b/VocaluxeLib/Log/CLog.cs @@ -50,7 +50,7 @@ namespace VocaluxeLib.Log /// The name of the log for song problems. /// The name of the file which is used as crash marker. /// The current version tag as it is displayed in the main menu. - /// Delegate to the function wchih should be called if the reporter have to been shown. + /// Delegate to the function which should be called if the reporter have to been shown. public static void Init(string logFolder, string fileNameMainLog, string fileNameSongInfoLog, string fileNameCrashMarker, string currentVersion, ShowReporterDelegate showReporterFunc) { _LogFolder = logFolder; @@ -156,6 +156,12 @@ namespace VocaluxeLib.Log _MainLogStringWriter.Flush(); // Show the Reporter _ShowReporterFunc(crash: crash, showContinue: showContinue, vocaluxeVersionTag: _CurrentVersion, log: _MainLogStringBuilder.ToString(), lastError: _FormatMessageTemplate(messageTemplate, propertyValues)); + + // Delete the crash marker (we do not want to show this error again on the next restart) + if (!showContinue) + { + File.Delete(_CrashMarkerFilePath); + } } ///