From 1645b1ed6264597964e502a22f5f42740b5a4789 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Wed, 11 Oct 2023 10:31:59 +0200 Subject: [PATCH] AchievementManager: Call ActivateDeactivateLeaderboards() and ActivateDeactivateRichPresence() under lock. Both of these functions access `m_game_data` and don't lock themselves, so they must be called in a way that guarantees that `m_game_data` is not modified during the call. --- Source/Core/Core/AchievementManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/AchievementManager.cpp b/Source/Core/Core/AchievementManager.cpp index fe955e6053..1b6ff11d8e 100644 --- a/Source/Core/Core/AchievementManager.cpp +++ b/Source/Core/Core/AchievementManager.cpp @@ -191,6 +191,8 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path, m_is_game_loaded = true; LoadUnlockData([](ResponseType r_type) {}); ActivateDeactivateAchievements(); + ActivateDeactivateLeaderboards(); + ActivateDeactivateRichPresence(); PointSpread spread = TallyScore(); if (hardcore_mode_enabled) { @@ -209,8 +211,6 @@ void AchievementManager::LoadGameByFilenameAsync(const std::string& iso_path, OSD::AddMessage("Hardcore mode is OFF", OSD::Duration::VERY_LONG, OSD::Color::CYAN); } } - ActivateDeactivateLeaderboards(); - ActivateDeactivateRichPresence(); FetchBadges(); // Reset this to zero so that RP immediately triggers on the first frame m_last_ping_time = 0;