From a75feba4caee67f66a937721bdbd0b3d5eda7149 Mon Sep 17 00:00:00 2001 From: nerix Date: Wed, 22 Feb 2023 13:01:47 +0100 Subject: [PATCH] Use `unique_lock` when loading 7TV badges (#4402) Co-authored-by: Rasmus Karlsson --- CHANGELOG.md | 1 + src/providers/seventv/SeventvBadges.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4e53929..d0bddeaad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Minor: Delete all but the last 5 crashdumps on application start. (#4392) - Bugfix: Fixed uploaded AppImage not being able most web requests. (#4400) +- Bugfix: Fixed a potential race condition due to using the wrong lock when loading 7TV badges. (#4402) - Dev: Add capability to build Chatterino with Qt6. (#4393) - Dev: Fix homebrew update action. (#4394) diff --git a/src/providers/seventv/SeventvBadges.cpp b/src/providers/seventv/SeventvBadges.cpp index 9bdc51bf6..1216d0863 100644 --- a/src/providers/seventv/SeventvBadges.cpp +++ b/src/providers/seventv/SeventvBadges.cpp @@ -45,7 +45,7 @@ void SeventvBadges::loadSeventvBadges() .onSuccess([this](const NetworkResult &result) -> Outcome { auto root = result.parseJson(); - std::shared_lock lock(this->mutex_); + std::unique_lock lock(this->mutex_); int index = 0; for (const auto &jsonBadge : root.value("badges").toArray())