Make WebClient instance local

This commit is contained in:
Travis Nickles 2018-12-14 01:45:05 -06:00
parent f6bb47451e
commit 4d5ff945d8

View File

@ -37,7 +37,6 @@ namespace DS4Windows
private ToolStripMenuItem[] shortcuts;
private ToolStripMenuItem[] disconnectShortcuts;
protected CheckBox[] linkedProfileCB;
WebClient wc = new WebClient();
NonFormTimer hotkeysTimer = new NonFormTimer();
NonFormTimer autoProfilesTimer = new NonFormTimer();
string tempProfileProgram = string.Empty;
@ -292,6 +291,7 @@ namespace DS4Windows
if (checkwhen > 0 && DateTime.Now >= LastChecked + TimeSpan.FromHours(checkwhen))
{
WebClient wc = new WebClient();
wc.DownloadFileAsync(url, appdatapath + "\\version.txt");
wc.DownloadFileCompleted += (sender, e) => { TaskRunner.Run(() => Check_Version(sender, e)); };
LastChecked = DateTime.Now;