From ba71f6fb77b90c305f637691561cb3988ec19d12 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Sun, 5 Feb 2017 19:53:13 +1100 Subject: [PATCH] Add missing unsafe block to check for main thread macOS --- src/platform/macos/window.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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) {