mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02: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;
|
return &ctx->base;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (ctx) {
|
if (ctx)
|
||||||
for (int i = 0; i < ARRAY_SIZE(ctx->batches); ++i) {
|
zink_context_destroy(&ctx->base);
|
||||||
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);
|
|
||||||
}
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue