From 93774ee37cd796f30a8a577daf8ec877e6109fad Mon Sep 17 00:00:00 2001 From: nmzik Date: Mon, 27 Jul 2026 02:27:37 +0200 Subject: [PATCH] fix teardown --- src/emulator.cpp | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/emulator.cpp b/src/emulator.cpp index 5ef3a79ff..54fb5cfab 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -160,24 +160,14 @@ static void LoadElf(const std::filesystem::path& elf, bool dbg_print_reloc = fal } static void Execute() { - int thread_model = 1; - - if (thread_model == 0) { - Common::Thread t([](void* /*unused*/) { Libs::Graphics::WindowRun(); }, nullptr); - t.Detach(); - auto* rt = Common::Singleton::Instance(); - rt->Execute(); - } else { - Common::Thread t( - [](void* /*unused*/) { - auto* rt = Common::Singleton::Instance(); - rt->Execute(); - }, - nullptr); - t.Detach(); - Libs::Graphics::WindowRun(); - t.Join(); - } + Common::Thread guest_thread( + [](void* /*unused*/) { + auto* rt = Common::Singleton::Instance(); + rt->Execute(); + }, + nullptr); + Libs::Graphics::WindowRun(); + std::quick_exit(0); } void Run(const RunOptions& options) {