Skip to content

Commit

Permalink
fixed missing disposal on update check
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Grabarevic committed Feb 27, 2017
1 parent 7dbddb1 commit c36b772
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions BuildsAppReborn.Client/UpdateChecker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,28 @@ private async Task UpdateCheckInternal()
try
{
var repo = Settings.Default.UpdateCheckUrl;
var updateMgrTask = UpdateManager.GitHubUpdateManager(repo, null, null, null, GeneralSettings.IncludePreReleases);

var updateManager = await updateMgrTask;

if (!GeneralSettings.AutoInstall)
{
var updateInfo = await updateManager.CheckForUpdate();
if (GeneralSettings.NotifyOnNewUpdate)
{
// ToDo: show if new update available
}
// ToDo: implement update when user accepts
}
else
using (var updateMgrTask = UpdateManager.GitHubUpdateManager(repo, null, null, null, GeneralSettings.IncludePreReleases))
{
var result = await updateManager.UpdateApp();
if (GeneralSettings.NotifyOnNewUpdate)
using (var updateManager = await updateMgrTask)
{
if (result == null) this.notificationProvider.ShowMessage($"{this.version.ProductName} Update Check finished", "Currently no new updates");
else this.notificationProvider.ShowMessage($"{this.version.ProductName} New update found!", "Update will be installed automatically on next start.");
if (!GeneralSettings.AutoInstall)
{
var updateInfo = await updateManager.CheckForUpdate();
if (GeneralSettings.NotifyOnNewUpdate)
{
// ToDo: show if new update available
}
// ToDo: implement update when user accepts
}
else
{
var result = await updateManager.UpdateApp();
if (GeneralSettings.NotifyOnNewUpdate)
{
if (result == null) this.notificationProvider.ShowMessage($"{this.version.ProductName} Update Check finished", "Currently no new updates");
else this.notificationProvider.ShowMessage($"{this.version.ProductName} New update found!", "Update will be installed automatically on next start.");
}
}
}
}
}
Expand Down

0 comments on commit c36b772

Please sign in to comment.