[PowerToys Run] Crash on exit, logs (#11509)

This commit is contained in:
Mykhailo Pylyp
2021-05-31 13:00:06 +03:00
committed by GitHub
parent 338b7b8a29
commit 3807673574
3 changed files with 19 additions and 4 deletions

View File

@@ -170,9 +170,23 @@ namespace PowerLauncher
private void RegisterExitEvents()
{
AppDomain.CurrentDomain.ProcessExit += (s, e) => Dispose();
Current.Exit += (s, e) => Dispose();
Current.SessionEnding += (s, e) => Dispose();
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
{
Log.Info("AppDomain.CurrentDomain.ProcessExit", GetType());
Dispose();
};
Current.Exit += (s, e) =>
{
Log.Info("Application.Current.Exit", GetType());
Dispose();
};
Current.SessionEnding += (s, e) =>
{
Log.Info("Application.Current.SessionEnding", GetType());
Dispose();
};
}
/// <summary>