From 1d17d8d0b3c807a7c97097c6bfed152ffa78c014 Mon Sep 17 00:00:00 2001 From: Hirek Date: Sun, 16 Nov 2025 18:20:04 +0100 Subject: [PATCH] Fix closing threads --- application.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/application.cpp b/application.cpp index 83debea4..8d1c965a 100644 --- a/application.cpp +++ b/application.cpp @@ -581,8 +581,19 @@ eu07_application::run() { } } Global.applicationQuitOrder = true; - Global.threads["DiscordRPC"].join(); // wait for DiscordRPC thread to finish - Global.threads["LogService"].join(); // wait for logging thread to finish + auto it = Global.threads.find("LogService"); + if (it != Global.threads.end()) + { + if (it->second.joinable()) + it->second.join(); + } + + it = Global.threads.find("DiscordRPC"); + if (it != Global.threads.end()) + { + if (it->second.joinable()) + it->second.join(); + } return 0; }