fix swapchain framebuffer leak on exit
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is passing Details

pull/18/head
cosmonaut 2022-03-06 22:27:00 -08:00
parent 74c5ac984c
commit 2b092ca387
1 changed files with 9 additions and 7 deletions

View File

@ -4556,6 +4556,15 @@ static void VULKAN_DestroyDevice(
VULKAN_Wait(device->driverData); VULKAN_Wait(device->driverData);
for (i = renderer->swapchainDataCount - 1; i >= 0; i -= 1)
{
VULKAN_INTERNAL_DestroySwapchain(renderer, renderer->swapchainDatas[i]->windowHandle);
}
SDL_free(renderer->swapchainDatas);
VULKAN_Wait(device->driverData);
SDL_free(renderer->submittedCommandBuffers); SDL_free(renderer->submittedCommandBuffers);
VULKAN_INTERNAL_DestroyBuffer(renderer, renderer->dummyVertexUniformBuffer->vulkanBuffer); VULKAN_INTERNAL_DestroyBuffer(renderer, renderer->dummyVertexUniformBuffer->vulkanBuffer);
@ -4715,13 +4724,6 @@ static void VULKAN_DestroyDevice(
VULKAN_INTERNAL_DestroyUniformBufferPool(renderer, renderer->fragmentUniformBufferPool); VULKAN_INTERNAL_DestroyUniformBufferPool(renderer, renderer->fragmentUniformBufferPool);
VULKAN_INTERNAL_DestroyUniformBufferPool(renderer, renderer->computeUniformBufferPool); VULKAN_INTERNAL_DestroyUniformBufferPool(renderer, renderer->computeUniformBufferPool);
for (i = renderer->swapchainDataCount - 1; i >= 0; i -= 1)
{
VULKAN_INTERNAL_DestroySwapchain(renderer, renderer->swapchainDatas[i]->windowHandle);
}
SDL_free(renderer->swapchainDatas);
for (i = 0; i < renderer->framebufferHashArray.count; i += 1) for (i = 0; i < renderer->framebufferHashArray.count; i += 1)
{ {
VULKAN_INTERNAL_DestroyFramebuffer( VULKAN_INTERNAL_DestroyFramebuffer(