Skip to content
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: crash when WindowButtonsProxy references cleared NSWindow #33069

Merged
merged 2 commits into from Mar 29, 2022

Conversation

gerhardberger
Copy link
Contributor

@gerhardberger gerhardberger commented Feb 24, 2022

Description of Change

This PR resets the WindowButtonsProxy in NativeWindowMac when deleting the underlying NSWindow. This is needed, because WindowButtonsProxy has a reference to NSWindow, which is not cleared when NSWindow is. This can cause a crash when WindowButtonsProxy calls something on the NSWindow when that is already cleared.

We ran into this crash at Around only when we were updating our electron app and wanted to quit the application and restart a new one. So it's hard to formulate a repro for this.

Checklist

  • PR description included and stakeholders cc'd

Release Notes

Notes: Fix crash when WindowButtonsProxy references cleared NSWindow

@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 24, 2022
@gerhardberger gerhardberger changed the title Fix crash when WindowButtonsProxy references cleared NSWindow fix: crash when WindowButtonsProxy references cleared NSWindow Feb 24, 2022
shell/browser/native_window_mac.mm Outdated Show resolved Hide resolved
@samuelmaddock samuelmaddock added the semver/patch backwards-compatible bug fixes label Mar 1, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 1, 2022
@samuelmaddock samuelmaddock added new-pr 🌱 PR opened in the last 24 hours target/14-x-y labels Mar 1, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Mar 1, 2022
Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

@gerhardberger can you rebase your PR on the latest from main? I believe that will resolve the failing CI/tests.

@jkleinsc jkleinsc merged commit 4aeeb64 into electron:main Mar 29, 2022
@release-clerk
Copy link

release-clerk bot commented Mar 29, 2022

Release Notes Persisted

Fix crash when WindowButtonsProxy references cleared NSWindow

@trop
Copy link
Contributor

trop bot commented Mar 29, 2022

I have automatically backported this PR to "15-x-y", please check out #33487

@trop trop bot removed the target/15-x-y label Mar 29, 2022
@trop
Copy link
Contributor

trop bot commented Mar 29, 2022

I have automatically backported this PR to "17-x-y", please check out #33488

@trop
Copy link
Contributor

trop bot commented Mar 29, 2022

I have automatically backported this PR to "16-x-y", please check out #33489

@trop
Copy link
Contributor

trop bot commented Mar 29, 2022

I have automatically backported this PR to "18-x-y", please check out #33490

bavulapati pushed a commit to bavulapati/electron that referenced this pull request Apr 29, 2022
…ron#33069)

* resets WindowButtonsProxy on window delete on macOS

* fixes reset
khalwa pushed a commit to solarwindscloud/electron that referenced this pull request Feb 22, 2023
…ron#33069)

* resets WindowButtonsProxy on window delete on macOS

* fixes reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants