From efe65520de781e53dbb1151b8e6e2f8943180072 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 31 Dec 2015 20:58:30 +0100 Subject: [PATCH] Fix possible update failure (doesn't help shipped code, but oh well...) * Apparently Application.Exit() doesn't close immediately and can throw an exception, leaving the UI open while the updater tries to run and nothing works. Environment.Exit(0) should do better hopefully. --- renderdocui/Windows/Dialogs/UpdateDialog.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/renderdocui/Windows/Dialogs/UpdateDialog.cs b/renderdocui/Windows/Dialogs/UpdateDialog.cs index 4d9fb4a5e..5f0255bae 100644 --- a/renderdocui/Windows/Dialogs/UpdateDialog.cs +++ b/renderdocui/Windows/Dialogs/UpdateDialog.cs @@ -135,12 +135,13 @@ namespace renderdocui.Windows.Dialogs try { process.Start(); - Application.Exit(); + Environment.Exit(0); } - catch (Exception) + catch (Exception ex) { // if there was an exception, display an error and don't exit. - MessageBox.Show("Unknown error encountered while trying to launch updater!", "Error updating", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(String.Format("Unknown error '{0}' encountered while trying to launch updater!", ex), + "Error updating", MessageBoxButtons.OK, MessageBoxIcon.Error); Close(); } });