[CSHARP-1223] JsonWriter Closes Underlying TextWriter Upon Dispose Created: 25/Mar/15  Updated: 02/Apr/15  Resolved: 26/Mar/15

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0

Type: Bug Priority: Major - P3
Reporter: Craig Wilson Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

JsonWriter, unlike JsonReader, BsonWriter, and BsonReader, closes the underlying TextWriter when it is disposed:

https://github.com/mongodb/mongo-csharp-driver/blob/05d5932ebff415684cc5bbb38b5b82da92a636c0/src/MongoDB.Bson/IO/JsonWriter.cs#L658

This should not happen.



 Comments   
Comment by Githook User [ 26/Mar/15 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}

Message: CSHARP-1223: JsonWriter does not own the TextWriter passed to the constructor so it should not call Dispose on it.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/b8fa23936bb795615187f5d8056d18c47cd37d7a

Generated at Wed Feb 07 21:39:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.