From 04c0e318becf250355e79b681f45031c6db3f117 Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Sun, 20 Dec 2015 14:08:19 +1300 Subject: [PATCH] -Don't call JsonWriter.Close when not disposing --- Src/Newtonsoft.Json/JsonWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Newtonsoft.Json/JsonWriter.cs b/Src/Newtonsoft.Json/JsonWriter.cs index a6bc5342..e467a71d 100644 --- a/Src/Newtonsoft.Json/JsonWriter.cs +++ b/Src/Newtonsoft.Json/JsonWriter.cs @@ -1446,7 +1446,7 @@ namespace Newtonsoft.Json /// true to release both managed and unmanaged resources; false to release only unmanaged resources. protected virtual void Dispose(bool disposing) { - if (_currentState != State.Closed) + if (_currentState != State.Closed && disposing) { Close(); }