File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -121,14 +121,16 @@ void SwapChainVk::cleanup_swapchain() {
121121void SwapChainVk::destroy () {
122122 auto vk_device = device_->get_device ();
123123
124+ vkQueueWaitIdle (device_->get_graphics_queue ());
125+ vkQueueWaitIdle (device_->get_present_queue ());
126+
124127 encoder_of_last_frame_.reset ();
125128
126129 // Clean up swap chain related resources.
127130 cleanup_swapchain ();
128131
129132 for (size_t i = 0 ; i < swapchain_images_.size (); i++) {
130133 vkDestroySemaphore (vk_device, render_finished_semaphores_[i], nullptr );
131- ;
132134 }
133135
134136 // Clean up sync objects.
Original file line number Diff line number Diff line change @@ -98,6 +98,7 @@ void WindowBuilderVk::stop_and_destroy_swapchains() {
9898 }
9999
100100 primary_window_->swapchain_ ->destroy ();
101+ primary_window_->destroy ();
101102}
102103
103104uint8_t WindowBuilderVk::create_window (const Vec2I &size, const std::string &title) {
You can’t perform that action at this time.
0 commit comments