清理所有资源,有两处内存泄漏,暂时找不到了

This commit is contained in:
xsl
2025-11-12 15:03:15 +08:00
parent 8623b71ab7
commit e23ccd75cd
3 changed files with 159 additions and 11 deletions
+11
View File
@@ -599,12 +599,23 @@ void Application::cleanup() {
vkDestroyImageView(device, imageView, nullptr);
}
for (auto framebuffer : swapChainFramebuffers)
{
if (framebuffer != VK_NULL_HANDLE)
{
vkDestroyFramebuffer(device, framebuffer, nullptr);
}
}
swapChainFramebuffers.clear();
vkDestroySwapchainKHR(device, swapChain, nullptr);
vkDestroyDevice(device, nullptr);
vkDestroySurfaceKHR(instance, surface, nullptr);
vkDestroyInstance(instance, nullptr);
#ifdef _WIN32
glfwDestroyWindow(window);
glfwTerminate();