Skip to content

Fix crash on use-after-free on macOS#46

Merged
chrisduerr merged 1 commit into
alacritty:masterfrom
kchibisov:fix-macos-crash
Jun 18, 2022
Merged

Fix crash on use-after-free on macOS#46
chrisduerr merged 1 commit into
alacritty:masterfrom
kchibisov:fix-macos-crash

Conversation

@kchibisov

@kchibisov kchibisov commented Jun 17, 2022

Copy link
Copy Markdown
Member

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
Copy Markdown
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.

@chrisduerr chrisduerr left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

@madsmtm madsmtm left a comment

Copy link
Copy Markdown
Contributor

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)

Comment thread src/osx_clipboard.rs
@chrisduerr chrisduerr merged commit ed3dbd8 into alacritty:master Jun 18, 2022
@Lurk

Lurk commented Jun 20, 2022

Copy link
Copy Markdown
Contributor

@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