mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Don't use Environment.Exit (#20532)
* [Awake] Don't use Process.Exit and move to CsWin32 * [PowerLauncher] Remove unused API * [ColorPicker] Use cancellable NativeEventWaiter + cleanup using * [TextExtractor] Don't use Environment.Exit * [MeasureTool] Don't use Environment.Exit(0); * [FZE] don't use Environment.Exit and fix WaitForPowerToysRunner
This commit is contained in:
@@ -72,13 +72,16 @@ namespace PowerLauncher
|
||||
using (var application = new App())
|
||||
{
|
||||
application.InitializeComponent();
|
||||
|
||||
NativeEventWaiter.WaitForEventLoop(
|
||||
Constants.RunExitEvent(),
|
||||
() =>
|
||||
{
|
||||
Log.Warn("RunExitEvent was signaled. Exiting PowerToys", typeof(App));
|
||||
ExitPowerToys(application);
|
||||
}, NativeThreadCTS.Token);
|
||||
{
|
||||
Log.Warn("RunExitEvent was signaled. Exiting PowerToys", typeof(App));
|
||||
ExitPowerToys(application);
|
||||
},
|
||||
Application.Current.Dispatcher,
|
||||
NativeThreadCTS.Token);
|
||||
|
||||
if (powerToysPid != 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user