-
Notifications
You must be signed in to change notification settings - Fork 16.2k
fix: process.exit crash in nativeWindowOpen #30218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github really needs a :laughcry: emoji for times like this
Failure:
Is a known and unrelated flake. Merging. |
Release Notes Persisted
|
I have automatically backported this PR to "14-x-y", please check out #30235 |
/trop run backport-to 15-x-y |
The backport process for this PR has been manually initiated - sending your PR to |
I have automatically backported this PR to "15-x-y", please check out #30238 |
Description of Change
Fixes #29969.
If
nativeWindowOpen
is enabled and we callprocess.exit()
we perform a frame swap during window creation such that there's about a tick where Chromium is still working on the window at the same time we're destroying it viaelectron::WindowList::DestroyAllWindows()
.This creates this specific race condition where the underlying
ElectronNSWindow
will have been freed when we call intoNativeWindowMac
. We can fix this by ensuring we do not callDidFirstVisuallyNonEmptyPaint()
if the window is closed.Tested with https://gist.github.com/c45a3d632e1740fad6d3d8bb351af654.
Checklist
npm test
passesRelease Notes
Notes: Fixed a crash when
process.exit
is called andnativeWindowOpen
is enabled.