Dispose HttpResponseMessage
MODIFY
HiddenWallet/WebClients/BlockCypher/BlockCypherClient.cs
HiddenWallet/WebClients/BlockCypher/BlockCypherClient.cs
@@ -40,10 +40,9 @@ namespace HiddenWallet.WebClients.BlockCypher
public async Task<BlockCypherGeneralInformation> GetGeneralInformationAsync(CancellationToken cancel)
{
using(await _asyncLock.LockAsync())
+ using (HttpResponseMessage response =
+ await HttpClient.GetAsync("", HttpCompletionOption.ResponseContentRead, cancel))
{
- HttpResponseMessage response =
- await HttpClient.GetAsync("", HttpCompletionOption.ResponseContentRead, cancel);
-
if (!response.IsSuccessStatusCode) throw new HttpRequestException(response.StatusCode.ToString());
var json = JObject.Parse(await response.Content.ReadAsStringAsync());

Dispose HttpResponseMessage