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
fix: potential crash on macOS app exit #29941
Conversation
@@ -415,7 +415,7 @@ void ViewDidMoveToSuperview(NSView* self, SEL _cmd) { | |||
// Use an NSEvent monitor to listen for the wheel event. | |||
BOOL __block began = NO; | |||
wheel_event_monitor_ = [NSEvent | |||
addLocalMonitorForEventsMatchingMask:NSScrollWheelMask |
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.
this is deprecated in favor of NSEventMaskScrollWheel
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.
nice!
Release Notes Persisted
|
I was unable to backport this PR to "12-x-y" cleanly; |
I have automatically backported this PR to "13-x-y", please check out #29961 |
I have automatically backported this PR to "14-x-y", please check out #29962 |
Description of Change
Closes #29260.
Fixes an issue where Electron could crash after calling
app.quit()
on macOS. This can happen as a result of[NSEvent removeMonitor:]
(https://developer.apple.com/documentation/appkit/nsevent/1533709-removemonitor?language=objc) being called twice; from the documentation discussion:This fixes any potential issues by ensuring that we only call
[NSEvent removeMonitor:]
on a non-nilid
. Chromium uses a similar approach here.Checklist
npm test
passesRelease Notes
Notes: Fixes a potential crash when calling
app.quit()
on macOS.