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,8 +197,10 @@ impl Window {
|
||||||
pl_attribs: &PlatformSpecificWindowBuilderAttributes)
|
pl_attribs: &PlatformSpecificWindowBuilderAttributes)
|
||||||
-> Result<Window, CreationError>
|
-> Result<Window, CreationError>
|
||||||
{
|
{
|
||||||
if !msg_send![cocoa::base::class("NSThread"), isMainThread] {
|
unsafe {
|
||||||
panic!("Windows can only be created on the main thread on macOS");
|
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) {
|
let app = match Window::create_app(pl_attribs.activation_policy) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue