Skip to content

Commit e3692c7

Browse files
committed
For WinExe, expicitly exit after Avalonia dispatcher shutdown.
1 parent 38dde6f commit e3692c7

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

Desktop.Win/Program.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
using System.Threading.Tasks;
2-
using System.Threading;
3-
using System;
1+
using Avalonia;
2+
using Desktop.Shared.Services;
3+
using Immense.RemoteControl.Desktop.Shared.Services;
4+
using Immense.RemoteControl.Desktop.Shared.Startup;
5+
using Immense.RemoteControl.Desktop.UI;
6+
using Immense.RemoteControl.Desktop.UI.Services;
7+
using Immense.RemoteControl.Desktop.Windows.Startup;
48
using Microsoft.Extensions.DependencyInjection;
59
using Microsoft.Extensions.Logging;
610
using Remotely.Shared.Services;
7-
using Immense.RemoteControl.Desktop.Shared.Services;
8-
using System.Diagnostics;
911
using Remotely.Shared.Utilities;
10-
using Immense.RemoteControl.Desktop.Shared.Startup;
12+
using System;
13+
using System.Diagnostics;
1114
using System.Linq;
12-
using Immense.RemoteControl.Desktop.Windows.Startup;
13-
using Immense.RemoteControl.Desktop.UI.Services;
14-
using Avalonia;
15-
using Immense.RemoteControl.Desktop.UI;
16-
using Desktop.Shared.Services;
1715
using System.Runtime.Versioning;
16+
using System.Threading;
17+
using System.Threading.Tasks;
1818

1919
namespace Remotely.Desktop.Win;
2020

@@ -99,5 +99,8 @@ public static async Task Main(string[] args)
9999
await Task.Delay(Timeout.InfiniteTimeSpan, dispatcher.ApplicationExitingToken);
100100
}
101101
catch (TaskCanceledException) { }
102+
103+
// Output type is WinExe, so we need to explicitly exit.
104+
Environment.Exit(0);
102105
}
103106
}

0 commit comments

Comments
 (0)