mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 01:40:08 +01:00
radv: destroy the base object if VkCreateEvent() failed
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5868>
This commit is contained in:
parent
8ef52974cd
commit
ce7a7aeecc
1 changed files with 4 additions and 2 deletions
|
|
@ -5800,7 +5800,9 @@ static void radv_destroy_event(struct radv_device *device,
|
|||
const VkAllocationCallbacks* pAllocator,
|
||||
struct radv_event *event)
|
||||
{
|
||||
device->ws->buffer_destroy(event->bo);
|
||||
if (event->bo)
|
||||
device->ws->buffer_destroy(event->bo);
|
||||
|
||||
vk_object_base_finish(&event->base);
|
||||
vk_free2(&device->vk.alloc, pAllocator, event);
|
||||
}
|
||||
|
|
@ -5826,7 +5828,7 @@ VkResult radv_CreateEvent(
|
|||
RADEON_FLAG_VA_UNCACHED | RADEON_FLAG_CPU_ACCESS | RADEON_FLAG_NO_INTERPROCESS_SHARING,
|
||||
RADV_BO_PRIORITY_FENCE);
|
||||
if (!event->bo) {
|
||||
vk_free2(&device->vk.alloc, pAllocator, event);
|
||||
radv_destroy_event(device, pAllocator, event);
|
||||
return vk_error(device->instance, VK_ERROR_OUT_OF_DEVICE_MEMORY);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue