Skip to content

Commit

Permalink
Bugfix disposed stream
Browse files Browse the repository at this point in the history
Fixes #371
  • Loading branch information
LordMike committed Apr 6, 2021
1 parent e500d4a commit ef5d852
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion TMDbLib/Rest/RestRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ private HttpRequestMessage PrepRequest(HttpMethod method)
// Body
if (method == HttpMethod.Post && _bodyObj != null)
{
using MemoryStream ms = new MemoryStream();
#pragma warning disable IDISP001 // Dispose created. => Stream is used in HttpContent
MemoryStream ms = new MemoryStream();
#pragma warning restore IDISP001 // Dispose created.

using (StreamWriter sw = new StreamWriter(ms, _client.Encoding, 4096, true))
using (JsonTextWriter tw = new JsonTextWriter(sw))
Expand Down

0 comments on commit ef5d852

Please sign in to comment.