diff --git a/src/platform/macos/window.rs b/src/platform/macos/window.rs index ccc178eb..9c9e9ef4 100644 --- a/src/platform/macos/window.rs +++ b/src/platform/macos/window.rs @@ -197,8 +197,10 @@ impl Window { pl_attribs: &PlatformSpecificWindowBuilderAttributes) -> Result { - if !msg_send![cocoa::base::class("NSThread"), isMainThread] { - panic!("Windows can only be created on the main thread on macOS"); + 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) {