Commit 3515c97c authored by justcoding121's avatar justcoding121

try dispose until empty

parent 18fbc69a
...@@ -212,9 +212,12 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -212,9 +212,12 @@ namespace Titanium.Web.Proxy.Network.Tcp
@lock.Release(); @lock.Release();
} }
while (disposalBag.TryTake(out var connection)) while (!disposalBag.IsEmpty)
{ {
connection?.Dispose(); if (disposalBag.TryTake(out var connection))
{
connection?.Dispose();
}
} }
//cleanup every ten seconds by default //cleanup every ten seconds by default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment