Merge branch 'fix-no-texture-dups-crash' into 'master'

Fix crash when game closes if there are no duplicate textures loaded

See merge request KartKrew/Kart!1957
This commit is contained in:
James R. 2024-02-27 05:14:45 +00:00
commit 81c77fb3ea

View file

@ -141,13 +141,16 @@ void R_CheckTextureDuplicates(INT32 start, INT32 end)
void R_PrintTextureDuplicates(void) void R_PrintTextureDuplicates(void)
{ {
if (g_dups_thread.joinable())
{
g_dups_thread.join();
}
if (g_dups.empty()) if (g_dups.empty())
{ {
return; return;
} }
g_dups_thread.join();
for (auto [key, v] : g_dups) for (auto [key, v] : g_dups)
{ {
std::for_each(v.cbegin(), v.cend(), print_dup); std::for_each(v.cbegin(), v.cend(), print_dup);