Cocoa: Cleanup

(cherry picked from commit 2db528d8cd)
This commit is contained in:
Camilla Löwy 2022-07-07 22:48:03 +02:00
parent 8c63c935ea
commit 2f3c6aa150

View File

@ -479,9 +479,9 @@ void* _glfwLoadLocalVulkanLoaderNS(void)
if (!frameworksUrl) if (!frameworksUrl)
return NULL; return NULL;
CFURLRef url = CFURLCreateCopyAppendingPathComponent( CFURLRef loaderUrl = CFURLCreateCopyAppendingPathComponent(
kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false); kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false);
if (!url) if (!loaderUrl)
{ {
CFRelease(frameworksUrl); CFRelease(frameworksUrl);
return NULL; return NULL;
@ -490,10 +490,10 @@ void* _glfwLoadLocalVulkanLoaderNS(void)
char path[PATH_MAX]; char path[PATH_MAX];
void* handle = NULL; void* handle = NULL;
if (CFURLGetFileSystemRepresentation(url, true, (UInt8*) path, sizeof(path) - 1)) if (CFURLGetFileSystemRepresentation(loaderUrl, true, (UInt8*) path, sizeof(path) - 1))
handle = _glfw_dlopen(path); handle = _glfw_dlopen(path);
CFRelease(url); CFRelease(loaderUrl);
CFRelease(frameworksUrl); CFRelease(frameworksUrl);
return handle; return handle;
} }