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. 13
      ILSpy/App.xaml.cs

13
ILSpy/App.xaml.cs

@ -165,6 +165,9 @@ namespace ICSharpCode.ILSpy @@ -165,6 +165,9 @@ namespace ICSharpCode.ILSpy
}
}
[ThreadStatic]
static bool showingError;
static void UnhandledException(Exception exception)
{
Debug.WriteLine(exception.ToString());
@ -176,7 +179,17 @@ namespace ICSharpCode.ILSpy @@ -176,7 +179,17 @@ namespace ICSharpCode.ILSpy
break;
}
}
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

Loading…
Cancel
Save