We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7bf8259 commit ba50d00Copy full SHA for ba50d00
Src/SocketIoClientDotNet.net45/Client/Manager.cs
@@ -395,16 +395,11 @@ private void ProcessPacketQueue()
395
396
private void Cleanup()
397
{
398
- // Concurrent-queue makes a copy when calling GetEnumerator
399
- // which protects it from any changes done in Subs while calling destroy
400
- foreach (var sub in Subs)
+ // dequeue and destroy until empty
+ while (Subs.TryDequeue(out On.IHandle sub))
401
402
sub.Destroy();
403
}
404
-
405
- // dequeue until empty (ConcurrentQueue does not have a Clear() method)
406
- On.IHandle tmp;
407
- while (Subs.TryDequeue(out tmp));
408
409
410
public void Close()
0 commit comments