vk::raii:SwapchainKHR destructor segfaults on tutorial code

Following the docs tutorial, I found the app was segfaulting on close even after waiting for the device to idle. I thought this might be because of some subtle difference between what i’d written and the tutorial code, so I tried compiling exactly the attached C++ code (from the section on recreating the swapchain) and it also has the issue. After running in gdb I found the segfault occurred in the swapchain’s destructor.

See Segmentation fault on program termination with RAII Vulkan headers · Issue #138 · KhronosGroup/Vulkan-Tutorial · GitHub

If this is an actual issues with the tutorial code, we’ll fix it.