Fix crash when clicking acknowledge button on fleet alert

- Stop countdown timer before closing form
- Add FormClosing event handler to ensure cleanup
- Bump tray version to 1.6.1
This commit is contained in:
Proudlock
2026-09-08 17:58:23 -04:00
parent 14a8501569
commit cc42f51d87
2 changed files with 11 additions and 1 deletions

View File

@@ -37,6 +37,12 @@ internal sealed class FleetAlertForm : Form
ApplyRoundedCorners(); ApplyRoundedCorners();
Load += FleetAlertForm_Load; Load += FleetAlertForm_Load;
FormClosing += FleetAlertForm_FormClosing;
}
private void FleetAlertForm_FormClosing(object? sender, FormClosingEventArgs e)
{
countdownTimer?.Stop();
} }
private void FleetAlertForm_Load(object? sender, EventArgs e) private void FleetAlertForm_Load(object? sender, EventArgs e)
@@ -255,6 +261,7 @@ internal sealed class FleetAlertForm : Form
private void AcknowledgeButton_Click(object? sender, EventArgs e) private void AcknowledgeButton_Click(object? sender, EventArgs e)
{ {
countdownTimer?.Stop();
OnAcknowledgeClicked?.Invoke(this, EventArgs.Empty); OnAcknowledgeClicked?.Invoke(this, EventArgs.Empty);
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();
@@ -262,6 +269,7 @@ internal sealed class FleetAlertForm : Form
private void CloseButton_Click(object? sender, EventArgs e) private void CloseButton_Click(object? sender, EventArgs e)
{ {
countdownTimer?.Stop();
OnAcknowledgeClicked?.Invoke(this, EventArgs.Empty); OnAcknowledgeClicked?.Invoke(this, EventArgs.Empty);
DialogResult = DialogResult.OK; DialogResult = DialogResult.OK;
Close(); Close();

View File

@@ -71,7 +71,9 @@
copies of the exit-code handling. A tray that cannot open the channel copies of the exit-code handling. A tray that cannot open the channel
logs and keeps its timer, so the failure mode is "refresh is not logs and keeps its timer, so the failure mode is "refresh is not
immediate", not "session data stops working". Requires agent 1.11.0. --> immediate", not "session data stops working". Requires agent 1.11.0. -->
<Version>1.6.0</Version> <!-- 1.6.1: fix crash when clicking acknowledge button. The countdown timer
is now properly stopped before the form closes to prevent disposal issues. -->
<Version>1.6.1</Version>
<InvariantGlobalization>true</InvariantGlobalization> <InvariantGlobalization>true</InvariantGlobalization>
<RuntimeIdentifier>win-x64</RuntimeIdentifier> <RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained> <SelfContained>true</SelfContained>