Skip to content

fix: don't let pending shell operations block app exit on Windows - #52897

Merged
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-don-t-let-pending-shell-operations-block-app-exit-on-windows-1786954322219
Aug 17, 2026
Merged

fix: don't let pending shell operations block app exit on Windows#52897
MarshallOfSound merged 1 commit into
43-x-yfrom
trop/43-x-y-bp-fix-don-t-let-pending-shell-operations-block-app-exit-on-windows-1786954322219

Conversation

@trop

@trop trop Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Backport of #52888

See that PR for details.

Notes: Fixed an issue on Windows where the app process could fail to exit after app.quit() while a shell.openExternal() or shell.openPath() call was still waiting on a system "Open with" dialog.

shell.openExternal(), shell.openPath() and shell.showItemInFolder() run
ShellExecuteEx()/SHOpenFolderAndSelectItems() on a COM STA thread-pool
task with the default SKIP_ON_SHUTDOWN behaviour. A SKIP_ON_SHUTDOWN task
that has already started blocks ThreadPoolInstance::Shutdown(), and
ShellExecuteEx() can block inside the OS for as long as Windows is showing
UI for the request - for example the "you'll need a new app to open this
link" dialog for a URL scheme with no registered handler. The result is
that app.quit() never completes (the process lingers after 'quit' has
fired) until the user dismisses that system dialog.

Post these tasks with CONTINUE_ON_SHUTDOWN instead, matching Chrome's
platform_util::OpenItem, which uses that trait for the same reason. The
tasks only touch their bound arguments and OS APIs, so letting shutdown
proceed while one is still blocked in the shell is safe.

Fixes #52141.

No-Verification-Needed: Windows-only source not built on this host; verified via Windows CI experiment

Co-authored-by: Sam Attard <sattard@anthropic.com>
@trop
trop Bot requested a review from MarshallOfSound August 17, 2026 08:12
@trop trop Bot added 43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes labels Aug 17, 2026
@MarshallOfSound
MarshallOfSound enabled auto-merge (squash) August 17, 2026 08:13
@MarshallOfSound
MarshallOfSound merged commit 9f72679 into 43-x-y Aug 17, 2026
96 checks passed
@MarshallOfSound
MarshallOfSound deleted the trop/43-x-y-bp-fix-don-t-let-pending-shell-operations-block-app-exit-on-windows-1786954322219 branch August 17, 2026 09:45
@release-clerk

release-clerk Bot commented Aug 17, 2026

Copy link
Copy Markdown

Release Notes Persisted

Fixed an issue on Windows where the app process could fail to exit after app.quit() while a shell.openExternal() or shell.openPath() call was still waiting on a system "Open with" dialog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

43-x-y backport This is a backport PR semver/patch backwards-compatible bug fixes

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant