private static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e) { Log.E(e.Exception); Backend.Stop(); ShowCrash(e.Exception); Application.Exit(); }
private static void ThreadExceptionHandler(object sender, ThreadExceptionEventArgs t) { Log.E(t.Exception); Backend.Stop(); ShowCrash(t.Exception); Application.Exit(); }
static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args) { Backend.Stop(); Exception e = args.ExceptionObject as Exception; if (e != null) { Log.E(e); ShowCrash(e); } Application.Exit(); }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { Log.Line($"Form1_FormClosing: killing backend"); // might be called from non-ui thread when called in crash handler // due to Appliction.Exit. Don't do complicated things in that case if (!InvokeRequired) { // TODO: if we have multiple forms, only when last form is closed Backend.Stop(); Cef.Shutdown(); } Log.Close(); }