Skip to content

Commit 7ff1141

Browse files
committed
reverted Dispose method changes
1 parent 944b9de commit 7ff1141

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

Rubberduck.Parsing/VBA/RubberduckParser.cs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using System.Diagnostics;
1313
using Rubberduck.VBEditor.Extensions;
1414
using System.IO;
15-
using System.Linq;
1615
using NLog;
1716
// ReSharper disable LoopCanBeConvertedToQuery
1817

@@ -661,20 +660,10 @@ public void Dispose()
661660
{
662661
State.ParseRequest -= ReparseRequested;
663662

664-
if (_cancellationTokens.Any(cts => cts != null))
663+
if (_cancellationTokens[0] != null)
665664
{
666-
foreach (var cts in _cancellationTokens.ToList())
667-
{
668-
try
669-
{
670-
cts.Cancel();
671-
cts.Dispose();
672-
}
673-
finally
674-
{
675-
_cancellationTokens.Remove(cts);
676-
}
677-
}
665+
_cancellationTokens[0].Cancel();
666+
_cancellationTokens[0].Dispose();
678667
}
679668
}
680669
}

0 commit comments

Comments
 (0)