mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-24 10:56: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)
|
pl_attribs: &PlatformSpecificWindowBuilderAttributes)
|
||||||
-> Result<Window, CreationError>
|
-> Result<Window, CreationError>
|
||||||
{
|
{
|
||||||
|
unsafe {
|
||||||
if !msg_send![cocoa::base::class("NSThread"), isMainThread] {
|
if !msg_send![cocoa::base::class("NSThread"), isMainThread] {
|
||||||
panic!("Windows can only be created on the main thread on macOS");
|
panic!("Windows can only be created on the main thread on macOS");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let app = match Window::create_app(pl_attribs.activation_policy) {
|
let app = match Window::create_app(pl_attribs.activation_policy) {
|
||||||
Some(app) => app,
|
Some(app) => app,
|
||||||
|
|
Loading…
Add table
Reference in a new issue