mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 01:00:10 +01:00
radv: destroy the base object if VkCreateInstance() 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
50fdefc025
commit
0859dcb57c
1 changed files with 2 additions and 0 deletions
|
|
@ -662,6 +662,7 @@ VkResult radv_CreateInstance(
|
|||
|
||||
if (idx >= RADV_INSTANCE_EXTENSION_COUNT ||
|
||||
!radv_instance_extensions_supported.extensions[idx]) {
|
||||
vk_object_base_finish(&instance->base);
|
||||
vk_free2(&default_alloc, pAllocator, instance);
|
||||
return vk_error(instance, VK_ERROR_EXTENSION_NOT_PRESENT);
|
||||
}
|
||||
|
|
@ -718,6 +719,7 @@ VkResult radv_CreateInstance(
|
|||
|
||||
result = vk_debug_report_instance_init(&instance->debug_report_callbacks);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_object_base_finish(&instance->base);
|
||||
vk_free2(&default_alloc, pAllocator, instance);
|
||||
return vk_error(instance, result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue