Skip to content

avoid crash when window is null in become_first_responder#204

Merged
micahrj merged 3 commits intoRustAudio:masterfrom
httnn:macos-window-null
Apr 14, 2025
Merged

avoid crash when window is null in become_first_responder#204
micahrj merged 3 commits intoRustAudio:masterfrom
httnn:macos-window-null

Conversation

@httnn
Copy link
Contributor

@httnn httnn commented Apr 6, 2025

apparently newer Rust versions (starting with 1.86?) have stricter debug assertions regarding unsafe code which caused a crash under debug builds because window was null in the become_first_responder method.

this fix simply checks whether window is null or not.

@micahrj
Copy link
Member

micahrj commented Apr 11, 2025

It looks like the build is failing due to warnings in the objc crate. Those warnings have been addressed on the master branch but not on the latest version on crates.io: SSheldon/rust-objc#125

Long-term I think the best thing to do would be to switch to the objc2 crate, but my recommendation for now is to add the following to the top of lib.rs:

#![allow(unexpected_cfgs)]

@micahrj micahrj merged commit 3e12973 into RustAudio:master Apr 14, 2025
3 checks passed
Quant1um added a commit to blepfx/baseview that referenced this pull request Jul 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments