[Modify] Polish it

This commit is contained in:
sta 2021-04-20 20:16:33 +09:00
parent 27a23446fb
commit d7b3fef56d

View File

@ -472,19 +472,18 @@ namespace WebSocketSharp.Net
private void close (bool force)
{
if (_listening) {
_listening = false;
cleanupContextQueue (!force);
cleanupContextRegistry ();
var name = GetType ().ToString ();
var ex = new ObjectDisposedException (name);
cleanupWaitQueue (ex);
EndPointManager.RemoveListener (this);
_listening = false;
}
lock (_contextRegistrySync)
cleanupContextQueue (!force);
cleanupContextRegistry ();
var ex = new ObjectDisposedException (GetType ().ToString ());
cleanupWaitQueue (ex);
_disposed = true;
}