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 on use-after-free on macOS #46

Merged
merged 1 commit into from
Jun 18, 2022

Conversation

kchibisov
Copy link
Member

@kchibisov kchibisov commented Jun 17, 2022

The code is inspired by glfw NSPasteboard clipboard loading.

Fixes alacritty/alacritty#6141.

@kchibisov kchibisov requested a review from chrisduerr June 17, 2022 20:24
The code is inspired by glfw NSPasteboard clipboard loading.

Fixes alacritty#6141.
@kchibisov
Copy link
Member Author

@Lurk does this fixes your issue as well? Since without it alacritty segfaults right away after your patch in #33.

For more see alacritty/alacritty#6141.

Copy link
Member

@chrisduerr chrisduerr left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@chrisduerr
Copy link
Member

Copy link
Contributor

@madsmtm madsmtm left a comment

Choose a reason for hiding this comment

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

Can attest that you now follow Cocoa's memory management rules properly (haven't tested it though)

src/osx_clipboard.rs Show resolved Hide resolved
@chrisduerr chrisduerr merged commit ed3dbd8 into alacritty:master Jun 18, 2022
@Lurk
Copy link
Contributor

Lurk commented Jun 20, 2022

@kchibisov I just checked, and there is no leak.

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

Successfully merging this pull request may close these issues.

Latest dev version crashes regularly on macOS
4 participants