[PATCH vkd3d 1/8] vkd3d: Simplify error handling in vkd3d_create_vk_device().

Henri Verbeet hverbeet at gmail.com
Thu Sep 27 16:51:12 CDT 2018


On 27 September 2018 at 15:00, Józef Kucia <joseph.kucia at gmail.com> wrote:
> @@ -1149,12 +1144,17 @@ static HRESULT vkd3d_create_vk_device(struct d3d12_device *device,
>      {
>          ERR("Failed to create queues, hr %#x.\n", hr);
>          device->vk_procs.vkDestroyDevice(vk_device, NULL);
> -        return hr;
> +        goto fail;
>      }
>
>      TRACE("Created Vulkan device %p.\n", vk_device);
>
> -    return S_OK;
> +fail:
> +    if (queue_properties)
> +        vkd3d_free(queue_properties);
> +    if (queue_info)
> +        vkd3d_free(queue_info);
> +    return hr;
>  }

I guess this is fine, but I'd feel a little better about it if the
label was called e.g. "done" in this case, since we're also going
through there on success.



More information about the wine-devel mailing list