Skip to content

Commit

Permalink
Merge pull request #66 from goodtrailer/kill-process
Browse files Browse the repository at this point in the history
Desktop: Kill process if failing to close after delay
  • Loading branch information
goodtrailer committed Apr 30, 2023
2 parents ec25893 + 6ed78bd commit 2f59f48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 10 additions & 1 deletion DailyDesktop.Desktop/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,16 @@ private async void MainForm_Load(object? sender, EventArgs e)
stateBackgroundWorker.RunWorkerAsync();
}

private void MainForm_FormClosing(object? sender, EventArgs e) => stateBackgroundWorker.CancelAsync();
private void MainForm_FormClosing(object? sender, EventArgs e)
{
stateBackgroundWorker.CancelAsync();
core.Dispose();

// TODO: SUPER SUPER SUPER BAD LOL WTF??
// investigate: maybe has something to do with ProviderStore not
// properly closing dlls?
Task.Delay(10_000).ContinueWith(_ => Process.GetCurrentProcess().Kill());
}

private async void providerComboBox_SelectedIndexChanged(object? sender, EventArgs e)
{
Expand Down
3 changes: 0 additions & 3 deletions DailyDesktop.Desktop/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -2864,9 +2864,6 @@ New releases: https://github.com/goodtrailer/daily-desktop/releases
5/8H24gfvKsP2DsAAAAASUVORK5CYII=
</value>
</data>
<metadata name="stateBackgroundWorker.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>158, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAA0AAAAAAAEAIACMJQAA1gAAAICAAAABACAAKAgBAGImAACAgAAAAQAIAChMAACKLgEAQEAAAAEA
Expand Down

0 comments on commit 2f59f48

Please sign in to comment.