diff --git a/src/StreamJsonRpc.Shared/JsonRpc.cs b/src/StreamJsonRpc.Shared/JsonRpc.cs index 1e8322f1..1672568a 100644 --- a/src/StreamJsonRpc.Shared/JsonRpc.cs +++ b/src/StreamJsonRpc.Shared/JsonRpc.cs @@ -213,6 +213,7 @@ namespace StreamJsonRpc // Dispose the stream and cancel pending requests in the finally block // So this is executed even if Disconnected event handler throws. this.disposeCts.Cancel(); + this.messageHandler.Dispose(); this.CancelPendingRequests(); } }