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 macos memory leaks #2739

Merged
merged 3 commits into from
Mar 14, 2023
Merged

Fix macos memory leaks #2739

merged 3 commits into from
Mar 14, 2023

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Mar 13, 2023

Fixes #2722 by patching objc2 instead, and using version ranges to allow the patched version to be selected.

If the user has accesskit_macos in their dependency tree, this will not work until @mwcampbell uses objc2 = ">=0.3.0-beta.3, <0.3.0-beta.4" in that.

  • Tested on all platforms changed
    • Currently very limited internet, and having a few problems with cargo update, so I can't test this fully myself right now. I have tested that the version resolution works though!
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users

@madsmtm madsmtm added B - bug Dang, that shouldn't have happened DS - macos B - regression labels Mar 13, 2023
@madsmtm madsmtm force-pushed the fix-macos-memory-leaks branch from 881a791 to 443064b Compare March 13, 2023 20:00
@madsmtm madsmtm mentioned this pull request Mar 13, 2023
5 tasks
@lunixbochs
Copy link
Contributor

this seems to fix the leak and not crash in both my simple example and my complex Talon test

@madsmtm
Copy link
Member Author

madsmtm commented Mar 14, 2023

Thanks @lunixbochs - I've tested it myself now as well.

@kchibisov: Feel free to include this in the next patch version of winit.

@madsmtm madsmtm merged commit 77f8e51 into master Mar 14, 2023
@madsmtm madsmtm deleted the fix-macos-memory-leaks branch March 14, 2023 10:27
kchibisov pushed a commit to kchibisov/winit that referenced this pull request Mar 16, 2023
* Use a weak reference from WinitView to WinitWindow

* Allow patched objc2 version

* Add changelog entry
kchibisov pushed a commit that referenced this pull request Mar 16, 2023
* Use a weak reference from WinitView to WinitWindow

* Allow patched objc2 version

* Add changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened B - regression DS - macos
Development

Successfully merging this pull request may close these issues.

Regression in 0.28 - NSWindow leaks on macOS
2 participants