From ce3e54b2d0a74212eac81e22eef6157b8df75b64 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Mon, 2 Mar 2026 10:15:52 +0100 Subject: [PATCH] default app_launcher destructor --- client/render/imgui_impl.cpp | 5 +++++ client/render/imgui_impl.h | 1 + client/scenes/app_launcher.cpp | 8 -------- client/scenes/app_launcher.h | 1 - 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/client/render/imgui_impl.cpp b/client/render/imgui_impl.cpp index 97f5d752..264fb713 100644 --- a/client/render/imgui_impl.cpp +++ b/client/render/imgui_impl.cpp @@ -209,6 +209,11 @@ imgui_textures::imgui_textures( this->image_cache = std::make_shared(device, physical_device, queue, queue_family_index); } +imgui_textures::~imgui_textures() +{ + device.waitIdle(); +} + std::vector> imgui_context::ray_plane_intersection(const imgui_context::controller_state & in) const { std::vector> intersections; diff --git a/client/render/imgui_impl.h b/client/render/imgui_impl.h index b659dd18..9ad71e58 100644 --- a/client/render/imgui_impl.h +++ b/client/render/imgui_impl.h @@ -68,6 +68,7 @@ public: uint32_t queue_family_index, thread_safe & queue, std::shared_ptr image_cache = {}); + ~imgui_textures(); ImTextureID load_texture(const std::string & filename, vk::raii::Sampler && sampler); ImTextureID load_texture(const std::string & filename); ImTextureID load_texture(const std::span & bytes, vk::raii::Sampler && sampler, const std::string & name = ""); diff --git a/client/scenes/app_launcher.cpp b/client/scenes/app_launcher.cpp index ca8e2e24..334bdba8 100644 --- a/client/scenes/app_launcher.cpp +++ b/client/scenes/app_launcher.cpp @@ -103,14 +103,6 @@ app_launcher::app_launcher( default_icon = textures.load_texture("assets://default_icon.ktx2"); } -app_launcher::~app_launcher() -{ - stream.device.waitIdle(); - for (const auto & [app_id, app_icon]: app_icons) - textures.free_texture(app_icon); - textures.free_texture(default_icon); -} - app_launcher::clicked app_launcher::draw_gui(imgui_context & imgui_ctx, const std::string & cancel) { auto res = clicked::None; diff --git a/client/scenes/app_launcher.h b/client/scenes/app_launcher.h index 7566013d..d0c8776f 100644 --- a/client/scenes/app_launcher.h +++ b/client/scenes/app_launcher.h @@ -50,7 +50,6 @@ class app_launcher public: app_launcher(scenes::stream &, std::string server_name); - ~app_launcher(); enum clicked { None,