Skip to content

fix(macOS): prevent crash on quit caused by double shutdown path#2129

Open
msavara wants to merge 1 commit intosourcegit-scm:developfrom
msavara:develop
Open

fix(macOS): prevent crash on quit caused by double shutdown path#2129
msavara wants to merge 1 commit intosourcegit-scm:developfrom
msavara:develop

Conversation

@msavara
Copy link

@msavara msavara commented Feb 13, 2026

fixes a macOS crash during app termination. App.Quit was closing MainWindow and then calling
desktop.Shutdown(exitCode). Because the app runs with ShutdownMode.OnMainWindowClose, closing the main window already
starts shutdown. Calling desktop.Shutdown again can re enter teardown while native AppKit and Avalonia dispatcher
resources are already being finalized, which can end in SIGABRT on quit. The fix keeps a single shutdown path by calling
only desktop.Shutdown(exitCode) in App.Quit, and it also adds a detailed inline comment that explains why this is
required on macOS.

Fixes a macOS crash during app termination. App.Quit was closing MainWindow and then calling
  desktop.Shutdown(exitCode). Because the app runs with ShutdownMode.OnMainWindowClose, closing the main window already
  starts shutdown. Calling desktop.Shutdown again can re enter teardown while native AppKit and Avalonia dispatcher
  resources are already being finalized, which can end in SIGABRT on quit. The fix keeps a single shutdown path by calling
  only desktop.Shutdown(exitCode) in App.Quit, and it also adds a detailed inline comment that explains why this is
  required on macOS.
@love-linger love-linger changed the base branch from master to develop February 13, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant