mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
zink: just call context destructor on creation fail
this more reliably handles the failure case Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9149>
This commit is contained in:
parent
66d5966426
commit
034657bf6c
1 changed files with 2 additions and 9 deletions
|
|
@ -1806,14 +1806,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
|||
return &ctx->base;
|
||||
|
||||
fail:
|
||||
if (ctx) {
|
||||
for (int i = 0; i < ARRAY_SIZE(ctx->batches); ++i) {
|
||||
vkDestroyDescriptorPool(screen->dev, ctx->batches[i].descpool, NULL);
|
||||
vkFreeCommandBuffers(screen->dev, ctx->batches[i].cmdpool, 1, &ctx->batches[i].cmdbuf);
|
||||
vkDestroyCommandPool(screen->dev, ctx->batches[i].cmdpool, NULL);
|
||||
}
|
||||
vkDestroyCommandPool(screen->dev, ctx->compute_batch.cmdpool, NULL);
|
||||
FREE(ctx);
|
||||
}
|
||||
if (ctx)
|
||||
zink_context_destroy(&ctx->base);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue