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. 38
      ILSpy/TextView/DecompilerTextView.cs

38
ILSpy/TextView/DecompilerTextView.cs

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

Loading…
Cancel
Save