Skip to content

Commit d7b3fef

Browse files
committed
[Modify] Polish it
1 parent 27a2344 commit d7b3fef

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

websocket-sharp/Net/HttpListener.cs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -472,18 +472,17 @@ private void cleanupWaitQueue (Exception exception)
472472
private void close (bool force)
473473
{
474474
if (_listening) {
475-
_listening = false;
476-
477-
EndPointManager.RemoveListener (this);
478-
}
479-
480-
lock (_contextRegistrySync)
481475
cleanupContextQueue (!force);
476+
cleanupContextRegistry ();
477+
478+
var name = GetType ().ToString ();
479+
var ex = new ObjectDisposedException (name);
480+
cleanupWaitQueue (ex);
482481

483-
cleanupContextRegistry ();
482+
EndPointManager.RemoveListener (this);
484483

485-
var ex = new ObjectDisposedException (GetType ().ToString ());
486-
cleanupWaitQueue (ex);
484+
_listening = false;
485+
}
487486

488487
_disposed = true;
489488
}

0 commit comments

Comments
 (0)