improve httpclient resource disposal

This commit is contained in:
Luke Pulverenti
2017-10-20 12:16:56 -04:00
parent 86226ff97c
commit 060215143f
36 changed files with 664 additions and 601 deletions

View File

@@ -293,10 +293,13 @@ namespace Emby.Server.Implementations.Security
options.SetPostData(data);
using (var json = (await _httpClient.Post(options).ConfigureAwait(false)).Content)
using (var response = (await _httpClient.Post(options).ConfigureAwait(false)))
{
reg = _jsonSerializer.DeserializeFromStream<RegRecord>(json);
success = true;
using (var json = response.Content)
{
reg = _jsonSerializer.DeserializeFromStream<RegRecord>(json);
success = true;
}
}
if (reg.registered)