if (out != VK_SUCCESS) {
fprintf(stderr, "Failed to create swapchain!\n");
printf("%d\n", out);
vkDestroySwapchainKHR(vulkanStruct->device, vulkanStruct->swapchain, NULL);
vkDestroySurfaceKHR(vulkanStruct->instance, vulkanStruct->surface, NULL); //why isn't this working
vkDestroyDevice(vulkanStruct->device, NULL);
vkDestroyInstance(vulkanStruct->instance, NULL);
glfwTerminate();
exit(EXIT_FAILURE);
}```
```json
VUID-vkDestroyInstance-instance-00629(ERROR / SPEC): msgNum: -1958900200 - Validation Error: [ VUID-vkDestroyInstance-instance-00629 ] Object 0: handle = 0x17e04211b50, type = VK_OBJECT_TYPE_INSTANCE; Object 1: handle = 0xfd5b260000000001, type = VK_OBJECT_TYPE_SURFACE_KHR; | MessageID = 0x8b3d8e18 | OBJ ERROR : For VkInstance 0x17e04211b50[], VkSurfaceKHR 0xfd5b260000000001[] has not been destroyed. The Vulkan spec states: All child objects created using instance must have been destroyed prior to destroying instance (https://vulkan.lunarg.com/doc/view/1.3.246.1/windows/1.3-extensions/vkspec.html#VUID-vkDestroyInstance-instance-00629)
Objects: 2
[0] 0x17e04211b50, type: 1, name: NULL
[1] 0xfd5b260000000001, type: 1000000000, name: NULL
I don't understand what could be the issue