Browse Source

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

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

16
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 {
#if DEBUG
if (Debugger.IsAttached) {
try { try {
AvalonEditTextOutput textOutput = new AvalonEditTextOutput(); AvalonEditTextOutput textOutput = new AvalonEditTextOutput();
textOutput.LengthLimit = outputLengthLimit; textOutput.LengthLimit = outputLengthLimit;
DecompileNodes(context, textOutput); DecompileNodes(context, textOutput);
textOutput.PrepareDocument(); textOutput.PrepareDocument();
tcs.SetResult(textOutput); tcs.SetResult(textOutput);
#if DEBUG
} catch (AggregateException ex) { } catch (AggregateException ex) {
tcs.SetException(ex); tcs.SetException(ex);
} catch (OperationCanceledException ex) { } catch (OperationCanceledException ex) {
tcs.SetException(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) { } catch (Exception ex) {
tcs.SetException(ex); tcs.SetException(ex);
#endif }
} }
})); }));
thread.Start(); thread.Start();

Loading…
Cancel
Save