From 9d0e01b073d86541cb15eeeafe6cf3cdb72b756e Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 26 Feb 2024 20:54:08 -0800 Subject: [PATCH] R_PrintTextureDuplicates: always join thread If the program exits without joining this thread, that's a crash. --- src/r_textures_dups.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/r_textures_dups.cpp b/src/r_textures_dups.cpp index 6b2fd54a7..ba167df80 100644 --- a/src/r_textures_dups.cpp +++ b/src/r_textures_dups.cpp @@ -141,13 +141,16 @@ void R_CheckTextureDuplicates(INT32 start, INT32 end) void R_PrintTextureDuplicates(void) { + if (g_dups_thread.joinable()) + { + g_dups_thread.join(); + } + if (g_dups.empty()) { return; } - g_dups_thread.join(); - for (auto [key, v] : g_dups) { std::for_each(v.cbegin(), v.cend(), print_dup);