mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-23 22:56:25 +00:00
Changed web client instances to dispose after use.
This commit is contained in:
parent
3cf603b1ad
commit
6410c28594
@ -137,9 +137,11 @@ namespace SpotifyAPI.SpotifyLocalAPI
|
||||
try
|
||||
{
|
||||
//Need to find a better solution
|
||||
var wc = new ExtendedWebClientInstance();
|
||||
if (SpotifyLocalAPIClass.IsSpotifyRunning())
|
||||
response = "[ " + wc.DownloadString(a) + " ]";
|
||||
using (var wc = new ExtendedWebClientInstance())
|
||||
{
|
||||
if (SpotifyLocalAPIClass.IsSpotifyRunning())
|
||||
response = "[ " + wc.DownloadString(a) + " ]";
|
||||
}
|
||||
}
|
||||
catch (Exception z)
|
||||
{
|
||||
@ -177,9 +179,11 @@ namespace SpotifyAPI.SpotifyLocalAPI
|
||||
try
|
||||
{
|
||||
//Need to find a better solution
|
||||
var wc = new ExtendedWebClientInstance();
|
||||
if (SpotifyLocalAPIClass.IsSpotifyRunning())
|
||||
response = "[ " + await wc.DownloadStringTaskAsync(new Uri(a)) + " ]";
|
||||
using (var wc = new ExtendedWebClientInstance())
|
||||
{
|
||||
if (SpotifyLocalAPIClass.IsSpotifyRunning())
|
||||
response = "[ " + await wc.DownloadStringTaskAsync(new Uri(a)) + " ]";
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user