diff --git a/src/corelib/kernel/qcore_mac.mm b/src/corelib/kernel/qcore_mac.mm index 6bf61b1155..6a8db38cc3 100644 --- a/src/corelib/kernel/qcore_mac.mm +++ b/src/corelib/kernel/qcore_mac.mm @@ -401,8 +401,8 @@ bool qt_apple_isSandboxed() { static bool isSandboxed = []() { QCFType staticCode = nullptr; - NSURL *bundleUrl = [[NSBundle mainBundle] bundleURL]; - if (SecStaticCodeCreateWithPath((__bridge CFURLRef)bundleUrl, + NSURL *executableUrl = NSBundle.mainBundle.executableURL; + if (SecStaticCodeCreateWithPath((__bridge CFURLRef)executableUrl, kSecCSDefaultFlags, &staticCode) != errSecSuccess) return false;