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