mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve & Fix
This commit is contained in:
parent
783cef6814
commit
b71e7226e5
1 changed files with 9 additions and 7 deletions
|
|
@ -243,23 +243,23 @@ namespace Flow.Launcher
|
|||
|
||||
private void RegisterExitEvents()
|
||||
{
|
||||
AppDomain.CurrentDomain.ProcessExit += (s, e) =>
|
||||
AppDomain.CurrentDomain.ProcessExit += async (s, e) =>
|
||||
{
|
||||
Log.Info("|App.RegisterExitEvents|Process Exit");
|
||||
_ = DisposeAsync();
|
||||
await DisposeAsync();
|
||||
};
|
||||
|
||||
Current.Exit += (s, e) =>
|
||||
Current.Exit += async (s, e) =>
|
||||
{
|
||||
NativeThreadCTS.Cancel();
|
||||
Log.Info("|App.RegisterExitEvents|Application Exit");
|
||||
_ = DisposeAsync();
|
||||
await DisposeAsync();
|
||||
};
|
||||
|
||||
Current.SessionEnding += (s, e) =>
|
||||
Current.SessionEnding += async (s, e) =>
|
||||
{
|
||||
Log.Info("|App.RegisterExitEvents|Session Ending");
|
||||
_ = DisposeAsync();
|
||||
await DisposeAsync();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -303,6 +303,8 @@ namespace Flow.Launcher
|
|||
_disposed = true;
|
||||
}
|
||||
|
||||
await Task.Delay(10000);
|
||||
|
||||
await Stopwatch.NormalAsync("|App.Dispose|Dispose cost", async () =>
|
||||
{
|
||||
Log.Info("|App.Dispose|Begin Flow Launcher dispose ----------------------------------------------------");
|
||||
|
|
@ -313,7 +315,7 @@ namespace Flow.Launcher
|
|||
await PluginManager.DisposePluginsAsync();
|
||||
|
||||
// Dispose needs to be called on the main Windows thread, since some resources owned by the thread need to be disposed.
|
||||
await _mainWindow?.Dispatcher.InvokeAsync(DisposeAsync);
|
||||
await _mainWindow?.Dispatcher.InvokeAsync(_mainWindow.Dispose);
|
||||
_mainVM?.Dispose();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue