mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-16 03:45:24 +00:00
c/util: Only destroy valid VkSemaphore handles
This commit is contained in:
parent
a123eb9f95
commit
6493564024
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2019-2022, Collabora, Ltd.
|
// Copyright 2019-2023, Collabora, Ltd.
|
||||||
// SPDX-License-Identifier: BSL-1.0
|
// SPDX-License-Identifier: BSL-1.0
|
||||||
/*!
|
/*!
|
||||||
* @file
|
* @file
|
||||||
|
@ -53,10 +53,13 @@ semaphore_destroy(struct xrt_compositor_semaphore *xcsem)
|
||||||
struct comp_semaphore *csem = comp_semaphore(xcsem);
|
struct comp_semaphore *csem = comp_semaphore(xcsem);
|
||||||
struct vk_bundle *vk = csem->vk;
|
struct vk_bundle *vk = csem->vk;
|
||||||
|
|
||||||
vk->vkDestroySemaphore( //
|
if (csem->semaphore != VK_NULL_HANDLE) {
|
||||||
vk->device, // device
|
vk->vkDestroySemaphore( //
|
||||||
csem->semaphore, // semaphore
|
vk->device, // device
|
||||||
NULL); // pAllocator
|
csem->semaphore, // semaphore
|
||||||
|
NULL); // pAllocator
|
||||||
|
csem->semaphore = VK_NULL_HANDLE;
|
||||||
|
}
|
||||||
|
|
||||||
free(csem);
|
free(csem);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue