mirror of https://github.com/mpv-player/mpv
mac/vulkan: error out on context creation without an NSApplication
if no NSApplication has been initialized, applications using Appkit functionality are not supposed to work properly or just deadlock indefinitely. properly error out on macvk context creation in that case.
This commit is contained in:
parent
4764e41cac
commit
8fc557cc6e
|
@ -56,6 +56,11 @@ static bool mac_vk_init(struct ra_ctx *ctx)
|
|||
struct mpvk_ctx *vk = &p->vk;
|
||||
int msgl = ctx->opts.probing ? MSGL_V : MSGL_ERR;
|
||||
|
||||
if (!NSApp) {
|
||||
MP_ERR(ctx, "Failed to initialize macvk context, no NSApplication initialized.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!mpvk_init(vk, ctx, VK_EXT_METAL_SURFACE_EXTENSION_NAME))
|
||||
goto error;
|
||||
|
||||
|
|
Loading…
Reference in New Issue