diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index 08d21eb0..9da1752c 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -285,9 +285,9 @@ namespace WebSocketSharp.Server internal void Add (string path, Func initializer) where TBehavior : WebSocketBehavior { - lock (_sync) { - path = HttpUtility.UrlDecode (path).TrimEndSlash (); + path = HttpUtility.UrlDecode (path).TrimEndSlash (); + lock (_sync) { WebSocketServiceHost host; if (_hosts.TryGetValue (path, out host)) { _logger.Error (