Skip to content

{DO NOT MERGE] main process didn't close properly on Windows, triggering breakpoint error#3480

Draft
panaC wants to merge 1 commit intodevelopfrom
window-end-session
Draft

{DO NOT MERGE] main process didn't close properly on Windows, triggering breakpoint error#3480
panaC wants to merge 1 commit intodevelopfrom
window-end-session

Conversation

@panaC
Copy link
Copy Markdown
Member

@panaC panaC commented Apr 2, 2026

Fixes #3479

During shutdown on Windows, there is not enough time to persist the final state.
When the application waits for persistence to finish before closing the main process, a Windows breakpoint error is raised. This error blocks the shutdown entirely instead of allowing the process to terminate gracefully in the background.

This PR is currently broken. I was not able to resolve the issue in time for the 3.4 release without refactoring how final persistence is handled during the Windows session-end events.

This is not a major issue, as the runtime and patches are recovered on the next startup. Thanks to this commit 4b53a27

The session-end event should immediately close or destroy all BrowserWindow instances, without attempting to perform additional work in the main process.
This issue may not be fully fixable on Windows, as the OS does not reliably allow enough time to persist the final state during shutdown or reboot.

…before triggering windows breakpoint error message!
@panaC panaC self-assigned this Apr 2, 2026

const endHandler = (event: Electron.Event) => {
debug("WINDOWS11 session-end event", event);
if (!library.isDestroyed()) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without force-closing the library windows, a system breakpoint error dialog is raised, blocking the shutdown process until the user confirms it by "OK"

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.

[Windows11 | linux] Shutdown/Reboot does not wait for main process to exit and save application state

1 participant