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.
This commit is contained in:
baldurk
2015-12-31 20:58:30 +01:00
parent efd8bf1baf
commit efe65520de
+4 -3
View File
@@ -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();
}
});