Browse Source

Hide the wait adorner once the decompile actually stops

Cancellation flips activeCts.Cancel() but doesn't interrupt the
Task.Run — CSharpDecompiler must reach the next ThrowIfCancellationRequested
before the action returns. The previous finally-less version returned
early on cts.IsCancellationRequested, leaving IsDecompiling = true and
the adorner stuck forever.

Assisted-by: Claude:claude-opus-4-7:Claude Code
pull/3755/head
Siegfried Pammer 2 months ago
parent
commit
914efdbeb5
  1. 15
      ILSpy/TextView/DecompilerTabPageModel.cs

15
ILSpy/TextView/DecompilerTabPageModel.cs

@ -152,13 +152,26 @@ namespace ILSpy.TextView @@ -152,13 +152,26 @@ namespace ILSpy.TextView
HighlightingModel = model;
Foldings = collectedFoldings;
Text = rendered;
IsDecompiling = false;
});
}
catch (OperationCanceledException)
{
// stale request — drop silently
}
finally
{
// Hide the wait adorner whether we finished, were cancelled, or aborted: a stale
// "Decompiling…" overlay is far worse than leaving the previous output visible.
// Skip the reset if a newer request has already taken over (activeCts is rotated
// at the top of DecompileAsync).
if (ReferenceEquals(activeCts, cts))
{
if (Dispatcher.UIThread.CheckAccess())
IsDecompiling = false;
else
await Dispatcher.UIThread.InvokeAsync(() => IsDecompiling = false);
}
}
}
}
}

Loading…
Cancel
Save