Skip to content

Commit

Permalink
fix(communication): Possible crash on closing the software
Browse files Browse the repository at this point in the history
  • Loading branch information
Belphemur committed Feb 10, 2025
1 parent 22920cd commit 5b8fd5c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions SoundSwitch/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ private static void Main()
case WindowsAPIAdapter.RestartManagerEventType.EndSession:
case WindowsAPIAdapter.RestartManagerEventType.ForceClose:
Log.Debug("Close Application");
try
{
mainCts.Cancel();
}
catch (Exception)
{
// We're closing anyway
}

Environment.Exit(0);
break;
}
Expand Down

0 comments on commit 5b8fd5c

Please sign in to comment.