These are chat archives for Ruhrpottpatriot/GW2.NET

10th
Oct 2016
Robert Logiewa
@Ruhrpottpatriot
Oct 10 2016 12:54
You know, one should not dispose of HttpContent, when you are going to need it later...
Happened to me just now. I debugged the code and was trying to find out why the HttpContent was disposed, even though it wasn't in a using statement and I was not calling Dispose(). Turns out the cause of this was my serialisation of the Headers, which used the HttpContentin a using statement and I overlooked that method...
Silly me.
Robert Logiewa
@Ruhrpottpatriot
Oct 10 2016 16:09
Ok, @StevenLiekens I need your input on this one, since you wrote it.
In the ISerializer<T> interface, the method Serialize(T value, Stream stream); returns void. It seems you did it that way, because JSON.Net does it that way. But depending on the stream we could have side effects here. Wouldn't it be better to return a completely new stream from the method instead of writing into the passed stream?
I added a comment in the interface, so we can revisit this at a later stage.