From 060215143ff62e4cf475a493e57c8607beca8640 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 20 Oct 2017 12:16:56 -0400 Subject: improve httpclient resource disposal --- Emby.Server.Implementations/Security/PluginSecurityManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Emby.Server.Implementations/Security/PluginSecurityManager.cs') diff --git a/Emby.Server.Implementations/Security/PluginSecurityManager.cs b/Emby.Server.Implementations/Security/PluginSecurityManager.cs index d42fae3ad..615ffa1f4 100644 --- a/Emby.Server.Implementations/Security/PluginSecurityManager.cs +++ b/Emby.Server.Implementations/Security/PluginSecurityManager.cs @@ -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(json); - success = true; + using (var json = response.Content) + { + reg = _jsonSerializer.DeserializeFromStream(json); + success = true; + } } if (reg.registered) -- cgit v1.2.3