# HG changeset patch # User Sam # Date 1671896283 -25200 # Node ID 227e53d1a853238ccacbcc758c4f0fcbdb57d09b # Parent 1134f41a49e95aa7d125f5abfa390efcdeed9702 fix: segfault on shutdown diff -r 1134f41a49e9 -r 227e53d1a853 src/engine.nim --- a/src/engine.nim Thu Dec 22 19:35:54 2022 +0700 +++ b/src/engine.nim Sat Dec 24 22:38:03 2022 +0700 @@ -557,7 +557,6 @@ if nextImageResult == VK_ERROR_OUT_OF_DATE_KHR: vulkan.frameDimension = window.getFrameDimension(vulkan.device.physicalDevice.device, vulkan.surface) (vulkan.swapchain, vulkan.framebuffers) = vulkan.recreateSwapchain() - return elif not (nextImageResult in [VK_SUCCESS, VK_SUBOPTIMAL_KHR]): raise newException(Exception, "Vulkan error: vkAcquireNextImageKHR returned " & $nextImageResult) checkVkResult vulkan.device.device.vkResetFences(1, addr(vulkan.inFlightFences[currentFrame])) @@ -642,5 +641,5 @@ when ENABLEVULKANVALIDATIONLAYERS: engine.vulkan.instance.vkDestroyDebugUtilsMessengerEXT(engine.vulkan.debugMessenger, nil) glslang_finalize_process() + engine.window.trash() engine.vulkan.instance.vkDestroyInstance(nil) - engine.window.trash()