[Fix] Use try-finally

This commit is contained in:
sta 2017-02-03 15:51:35 +09:00
parent 262922f049
commit a376f305c2

View File

@ -651,13 +651,17 @@ namespace WebSocketSharp.Server
_state = ServerState.ShuttingDown; _state = ServerState.ShuttingDown;
} }
try {
try { try {
_listener.Stop (); _listener.Stop ();
} }
finally {
_services.Stop (1006, String.Empty);
}
}
catch { catch {
} }
_services.Stop (1006, String.Empty);
_state = ServerState.Stop; _state = ServerState.Stop;
} }