From 034667f03b2003b82f51f011765228198891ed7b Mon Sep 17 00:00:00 2001 From: hg <4683435+hgtw@users.noreply.github.com> Date: Fri, 2 Sep 2022 22:49:14 -0400 Subject: [PATCH] [Bug Fix] Avoid erase in discord queue range loop (#2411) Erasing from the map inside the range loop invalidated the iterator used internally by the loop. This caused ucs access violations under msvc debug builds when a discord logging category was enabled. --- common/discord_manager.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/discord_manager.cpp b/common/discord_manager.cpp index 2e0143f6a..aac1dadcc 100644 --- a/common/discord_manager.cpp +++ b/common/discord_manager.cpp @@ -63,8 +63,7 @@ void DiscordManager::ProcessMessageQueue() webhook.webhook_url ); } - - webhook_message_queue.erase(q.first); } + webhook_message_queue.clear(); webhook_queue_lock.unlock(); }