1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-05-24 23:34:05 +02:00

Ninja fix deadlock when exiting after update

This commit is contained in:
chylex 2017-03-08 22:10:06 +01:00
parent 3a28556c7f
commit 67a2e40622
2 changed files with 8 additions and 5 deletions

View File

@ -244,11 +244,14 @@ private void updates_UpdateAccepted(object sender, UpdateAcceptedEventArgs e){
downloadForm.MoveToCenter(this); downloadForm.MoveToCenter(this);
downloadForm.ShowDialog(); downloadForm.ShowDialog();
if (downloadForm.UpdateStatus == FormUpdateDownload.Status.Succeeded){ FormUpdateDownload.Status status = downloadForm.UpdateStatus;
downloadForm.Dispose();
if (status == FormUpdateDownload.Status.Succeeded){
UpdateInstallerPath = downloadForm.InstallerPath; UpdateInstallerPath = downloadForm.InstallerPath;
ForceClose(); ForceClose();
} }
else if (downloadForm.UpdateStatus == FormUpdateDownload.Status.Manual){ else if (status == FormUpdateDownload.Status.Manual){
ForceClose(); ForceClose();
} }
else{ else{

View File

@ -67,12 +67,12 @@ public int Check(bool force){
private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){ private void TriggerUpdateAcceptedEvent(UpdateAcceptedEventArgs args){
if (UpdateAccepted != null){ if (UpdateAccepted != null){
form.InvokeSafe(() => UpdateAccepted(this, args)); form.InvokeAsyncSafe(() => UpdateAccepted(this, args));
} }
} }
private void TriggerUpdateDismissedEvent(UpdateDismissedEventArgs args){ private void TriggerUpdateDismissedEvent(UpdateDismissedEventArgs args){
form.InvokeSafe(() => { form.InvokeAsyncSafe(() => {
settings.DismissedUpdate = args.VersionTag; settings.DismissedUpdate = args.VersionTag;
if (UpdateDismissed != null){ if (UpdateDismissed != null){
@ -83,7 +83,7 @@ private void TriggerUpdateDismissedEvent(UpdateDismissedEventArgs args){
private void TriggerCheckFinishedEvent(UpdateCheckEventArgs args){ private void TriggerCheckFinishedEvent(UpdateCheckEventArgs args){
if (CheckFinished != null){ if (CheckFinished != null){
form.InvokeSafe(() => CheckFinished(this, args)); form.InvokeAsyncSafe(() => CheckFinished(this, args));
} }
} }