diff --git a/websocket-sharp/WebSocket.cs b/websocket-sharp/WebSocket.cs index a9636e6a2..ecb9c9e49 100644 --- a/websocket-sharp/WebSocket.cs +++ b/websocket-sharp/WebSocket.cs @@ -1569,6 +1569,10 @@ private void init () _messageEventQueue = new Queue (); _forMessageEventQueue = ((ICollection) _messageEventQueue).SyncRoot; _readyState = WebSocketState.New; + OnClose += (o, e) => + { + _messageEventQueue.Clear(); + }; } private void message ()