Browse Source

#2074: Don't open multiple crash dialogs at the same time.

pull/2077/head
Daniel Grunwald 5 years ago
parent
commit
7476ae8f40
  1. 15
      ILSpy/App.xaml.cs

15
ILSpy/App.xaml.cs

@ -165,6 +165,9 @@ namespace ICSharpCode.ILSpy
} }
} }
[ThreadStatic]
static bool showingError;
static void UnhandledException(Exception exception) static void UnhandledException(Exception exception)
{ {
Debug.WriteLine(exception.ToString()); Debug.WriteLine(exception.ToString());
@ -176,7 +179,17 @@ namespace ICSharpCode.ILSpy
break; break;
} }
} }
MessageBox.Show(exception.ToString(), "Sorry, we crashed"); if (showingError) {
// Ignore re-entrant calls
// We run the risk of opening an infinite number of exception dialogs.
return;
}
showingError = true;
try {
MessageBox.Show(exception.ToString(), "Sorry, we crashed");
} finally {
showingError = false;
}
} }
#endregion #endregion

Loading…
Cancel
Save