mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-24 02:46:33 +11:00
Add missing unsafe block to check for main thread macOS
This commit is contained in:
parent
926e03039f
commit
ba71f6fb77
1 changed files with 4 additions and 2 deletions
|
@ -197,9 +197,11 @@ impl Window {
|
|||
pl_attribs: &PlatformSpecificWindowBuilderAttributes)
|
||||
-> Result<Window, CreationError>
|
||||
{
|
||||
unsafe {
|
||||
if !msg_send![cocoa::base::class("NSThread"), isMainThread] {
|
||||
panic!("Windows can only be created on the main thread on macOS");
|
||||
}
|
||||
}
|
||||
|
||||
let app = match Window::create_app(pl_attribs.activation_policy) {
|
||||
Some(app) => app,
|
||||
|
|
Loading…
Add table
Reference in a new issue