Skip to content

Commit ccd25cd

Browse files
author
tznind
committed
Fix lock
1 parent 1bd5d8d commit ccd25cd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Terminal.Gui/ConsoleDrivers/AnsiResponseParser/AnsiResponseParser.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,17 +353,16 @@ public IEnumerable<Tuple<char, T>> ProcessInput (params Tuple<char, T> [] input)
353353
return output;
354354
}
355355

356-
public IEnumerable<Tuple<char, T>> Release ()
356+
public Tuple<char, T>[] Release ()
357357
{
358358
// Lock in case Release is called from different Thread from parse
359359
lock (lockState)
360360
{
361-
foreach (Tuple<char, T> h in HeldToEnumerable ())
362-
{
363-
yield return h;
364-
}
361+
Tuple<char, T> [] result = HeldToEnumerable ().ToArray ();
365362

366363
ResetState ();
364+
365+
return result;
367366
}
368367
}
369368

0 commit comments

Comments
 (0)