aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/x11_vulkan.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/x11_vulkan.c b/src/x11_vulkan.c
index 5b6745e..54b1218 100644
--- a/src/x11_vulkan.c
+++ b/src/x11_vulkan.c
@@ -36,15 +36,18 @@ puglNewVulkanLoader(PuglWorld* PUGL_UNUSED(world))
PuglVulkanLoader* const loader =
(PuglVulkanLoader*)calloc(1, sizeof(PuglVulkanLoader));
- if (loader) {
- loader->libvulkan = libvulkan;
+ if (!loader) {
+ dlclose(libvulkan);
+ return NULL;
+ }
- loader->vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dlsym(
- loader->libvulkan, "vkGetInstanceProcAddr");
+ loader->libvulkan = libvulkan;
- loader->vkGetDeviceProcAddr =
- (PFN_vkGetDeviceProcAddr)dlsym(loader->libvulkan, "vkGetDeviceProcAddr");
- }
+ loader->vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)dlsym(
+ loader->libvulkan, "vkGetInstanceProcAddr");
+
+ loader->vkGetDeviceProcAddr =
+ (PFN_vkGetDeviceProcAddr)dlsym(loader->libvulkan, "vkGetDeviceProcAddr");
return loader;
}