Realloc vk_swapchain.images so we don't leak

This commit is contained in:
Spirrwell 2021-06-08 03:54:17 -04:00
parent 38e3d897f3
commit c79fd42110

View file

@ -239,7 +239,7 @@ VkResult QVk_CreateSwapchain()
return res;
VK_VERIFY(vkGetSwapchainImagesKHR(vk_device.logical, vk_swapchain.sc, &imageCount, NULL));
vk_swapchain.images = (VkImage *)malloc(imageCount * sizeof(VkImage));
vk_swapchain.images = (VkImage *)realloc(vk_swapchain.images, imageCount * sizeof(VkImage));
vk_swapchain.imageCount = imageCount;
res = vkGetSwapchainImagesKHR(vk_device.logical, vk_swapchain.sc, &imageCount, vk_swapchain.images);