Data diagnostics opt-in

This commit is contained in:
Stefan Markovic
2024-09-24 13:47:38 +02:00
parent 2146dff3bf
commit bea3607ea0
242 changed files with 2546 additions and 1283 deletions

View File

@@ -46,6 +46,7 @@ namespace PowerLauncher
private SettingWindowViewModel _settingsVM;
private StringMatcher _stringMatcher;
private SettingsReader _settingsReader;
private ETWTrace etwTrace = new ETWTrace();
// To prevent two disposals running at the same time.
private static readonly object _disposingLock = new object();
@@ -95,12 +96,15 @@ namespace PowerLauncher
using (var application = new App())
{
application.InitializeComponent();
application.etwTrace.Start();
Common.UI.NativeEventWaiter.WaitForEventLoop(
Constants.RunExitEvent(),
() =>
{
Log.Warn("RunExitEvent was signaled. Exiting PowerToys", typeof(App));
application.etwTrace?.Dispose();
application.etwTrace = null;
ExitPowerToys(application);
},
Application.Current.Dispatcher,
@@ -111,6 +115,8 @@ namespace PowerLauncher
RunnerHelper.WaitForPowerToysRunner(powerToysPid, () =>
{
Log.Info($"Runner with pid={powerToysPid} exited. Exiting PowerToys Run", typeof(App));
application.etwTrace?.Dispose();
application.etwTrace = null;
ExitPowerToys(application);
});
}