Browse Source

Even in debug builds: catch decompiler exceptions when no debugger is attached.

pull/40/head
Daniel Grunwald 15 years ago
parent
commit
53fa2b3e91
  1. 16
      ILSpy/TextView/DecompilerTextView.cs

16
ILSpy/TextView/DecompilerTextView.cs

@ -264,21 +264,31 @@ namespace ICSharpCode.ILSpy.TextView @@ -264,21 +264,31 @@ namespace ICSharpCode.ILSpy.TextView
Thread thread = new Thread(new ThreadStart(
delegate {
#if DEBUG
if (Debugger.IsAttached) {
try {
AvalonEditTextOutput textOutput = new AvalonEditTextOutput();
textOutput.LengthLimit = outputLengthLimit;
DecompileNodes(context, textOutput);
textOutput.PrepareDocument();
tcs.SetResult(textOutput);
#if DEBUG
} catch (AggregateException ex) {
tcs.SetException(ex);
} catch (OperationCanceledException ex) {
tcs.SetException(ex);
#else
}
} else
#endif
{
try {
AvalonEditTextOutput textOutput = new AvalonEditTextOutput();
textOutput.LengthLimit = outputLengthLimit;
DecompileNodes(context, textOutput);
textOutput.PrepareDocument();
tcs.SetResult(textOutput);
} catch (Exception ex) {
tcs.SetException(ex);
#endif
}
}
}));
thread.Start();

Loading…
Cancel
Save