[Modify] Polish it

This commit is contained in:
sta 2021-04-06 19:39:50 +09:00
parent ce577ff0f7
commit ee3cadf19c

View File

@ -457,6 +457,7 @@ namespace WebSocketSharp.Net
private void cleanupContextRegistry ()
{
HttpListenerContext[] ctxs = null;
lock (_ctxRegistrySync) {
if (_ctxRegistry.Count == 0)
return;
@ -465,6 +466,7 @@ namespace WebSocketSharp.Net
var keys = _ctxRegistry.Keys;
ctxs = new HttpListenerContext[keys.Count];
keys.CopyTo (ctxs, 0);
_ctxRegistry.Clear ();
}