diff --git a/src/Workspaces/Core/Portable/Utilities/CancellationSeries.cs b/src/Workspaces/Core/Portable/Utilities/CancellationSeries.cs index 0dd0e7e17714c..f5072e2033b34 100644 --- a/src/Workspaces/Core/Portable/Utilities/CancellationSeries.cs +++ b/src/Workspaces/Core/Portable/Utilities/CancellationSeries.cs @@ -9,9 +9,6 @@ // reference implementation. using System; -#if DEBUG -using System.Diagnostics; -#endif using System.Threading; namespace Roslyn.Utilities @@ -42,22 +39,7 @@ public CancellationSeries(CancellationToken token = default) _cts.Cancel(); _superToken = token; - -#if DEBUG - _ctorStack = new StackTrace(); -#endif - } - -#if DEBUG - private readonly StackTrace _ctorStack; - - ~CancellationSeries() - { - Contract.ThrowIfFalse( - Environment.HasShutdownStarted || _cts == null, - $"Instance of CancellationSeries not disposed before being finalized{Environment.NewLine}Stack at construction:{Environment.NewLine}{_ctorStack}"); } -#endif /// /// Determines if the cancellation series has an active token which has not been cancelled. @@ -131,10 +113,6 @@ public CancellationToken CreateNext(CancellationToken token = default) public void Dispose() { -#if DEBUG - GC.SuppressFinalize(this); -#endif - var source = Interlocked.Exchange(ref _cts, null); if (source == null)