mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-20 21:01:06 +08:00
fix: app will crash when it is quiting from Dock (#2271)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -473,6 +473,17 @@ namespace SourceGit
|
||||
_launcher = new ViewModels.Launcher(startupRepo);
|
||||
desktop.MainWindow = new Views.Launcher() { DataContext = _launcher };
|
||||
desktop.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
||||
|
||||
// Fix macOS crash when quiting from Dock
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
desktop.ShutdownRequested += (_, e) =>
|
||||
{
|
||||
e.Cancel = true;
|
||||
Dispatcher.UIThread.Post(() => Quit(0));
|
||||
};
|
||||
}
|
||||
|
||||
desktop.Exit += (_, _) =>
|
||||
{
|
||||
_ipcChannel?.Dispose();
|
||||
|
||||
Reference in New Issue
Block a user