From 246e813195f3bf84fb48e3677936a75c703602b9 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Thu, 30 Jun 2016 21:56:39 -0600 Subject: [PATCH] Dispose of underlying streams when disconnected Fixes last two failing tests. --- src/StreamJsonRpc.Shared/JsonRpc.cs | 1 + 1 file changed, 1 insertion(+) 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(); } }