mirror of
https://github.com/QL-Win/QuickLook.git
synced 2026-05-16 01:08:03 +08:00
do not crash when other threads failed
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
</startup>
|
||||
<runtime>
|
||||
<legacyCorruptedStateExceptionsPolicy enabled="true" />
|
||||
<legacyUnhandledExceptionPolicy enabled="1" />
|
||||
</runtime>
|
||||
<userSettings>
|
||||
<QuickLook.Properties.Settings>
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -44,9 +45,13 @@ namespace QuickLook
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += (sender, args) =>
|
||||
{
|
||||
MessageBox.Show(((Exception) args.ExceptionObject).ToString());
|
||||
//MessageBox.Show(((Exception) args.ExceptionObject).ToString());
|
||||
|
||||
Shutdown();
|
||||
const string source = "QuickLook Application Error";
|
||||
if (!EventLog.SourceExists(source))
|
||||
EventLog.CreateEventSource(source, "Application");
|
||||
EventLog.WriteEntry(source, ((Exception) args.ExceptionObject).ToString(),
|
||||
EventLogEntryType.Error);
|
||||
};
|
||||
|
||||
base.OnStartup(e);
|
||||
|
||||
Reference in New Issue
Block a user