fix segfault

This commit is contained in:
pufferffish 2024-06-15 08:05:48 +01:00
parent 24c8840037
commit 724fac470f
2 changed files with 3 additions and 3 deletions

View File

@ -460,8 +460,7 @@ func LoadVulkanMgmt(vulkanLibPaths []string, capLibPaths []string) (int, *C.vk_h
C.vk_init(vkLib, capLib, &resp)
if resp.err != nil {
slog.Debug("Unable to load vulkan", "library", vkLibPath, "error", C.GoString(resp.err))
slog.Debug("Unable to load libcap", "library", capLibPath, "error", C.GoString(resp.err))
slog.Debug("Unable to load vulkan", "library", vkLibPath, capLibPath, "error", C.GoString(resp.err))
C.free(unsafe.Pointer(resp.err))
} else {
return int(resp.num_devices), &resp.ch, vkLibPath, capLibPath

View File

@ -122,7 +122,8 @@ void vk_init(char* vk_lib_path, char* cap_lib_path, vk_init_resp_t *resp) {
}
if (check_perfmon(&resp->ch) != 0) {
resp->err = "Performance monitoring is not allowed. Please enable CAP_PERFMON or run as root to use Vulkan.";
resp->err = strdup("performance monitoring is not allowed. Please enable CAP_PERFMON or run as root to use Vulkan.");
LOG(resp->ch.verbose, resp->err);
return;
}