mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-04-11 03:41:08 +00:00
[vulkan] Check output framebuffers exist before destroying
The output framebuffers array is dynamic, so trying to index it before it has been created results in a segfault (which is rather inconvenient during shutdown).
This commit is contained in:
parent
52f012cc11
commit
c512af4f21
1 changed files with 5 additions and 3 deletions
|
@ -378,10 +378,12 @@ Vulkan_Output_Shutdown (vulkan_ctx_t *ctx)
|
|||
qfv_devfuncs_t *dfunc = device->funcs;
|
||||
outputctx_t *octx = ctx->output_context;
|
||||
|
||||
for (uint32_t i = 0; i < ctx->swapchain->imageViews->size; i++) {
|
||||
dfunc->vkDestroyFramebuffer (device->dev, octx->framebuffers[i], 0);
|
||||
if (octx->framebuffers) {
|
||||
for (uint32_t i = 0; i < ctx->swapchain->imageViews->size; i++) {
|
||||
dfunc->vkDestroyFramebuffer (device->dev, octx->framebuffers[i], 0);
|
||||
}
|
||||
free (octx->framebuffers);
|
||||
}
|
||||
free (octx->framebuffers);
|
||||
auto step = QFV_FindStep ("output", ctx->render_context->job);
|
||||
auto render = step->render;
|
||||
auto rp = &render->renderpasses[0];
|
||||
|
|
Loading…
Reference in a new issue